0?Number(l):s;else if("string"!=typeof l)e.dtick=s;else{var u=l.charAt(0),c=l.substr(1);((c=r(c)?Number(c):0)<=0||!("date"===i&&"M"===u&&c===Math.round(c)||"log"===i&&"L"===u||"log"===i&&"D"===u&&(1===c||2===c)))&&(e.dtick=s)}var h="date"===i?ne.dateTick0(e.calendar):0,f=n("tick0",h);"date"===i?e.tick0=ne.cleanDate(f,h):r(f)&&"D1"!==l&&"D2"!==l?e.tick0=Number(f):e.tick0=h}else{void 0===n("tickvals")?e.tickmode="auto":n("ticktext")}},We=function(t){return void 0!==l[t]||c(t)},Ye=function(t,e,n,i,a){var o,s=a.prefix,l=a.cLetter,u=s.slice(0,s.length-1),c=s?ne.nestedProperty(t,u).get()||{}:t,h=s?ne.nestedProperty(e,u).get()||{}:e,f=c[l+"min"],p=c[l+"max"],d=c.colorscale;i(s+l+"auto",!(r(f)&&r(p)&&f","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}},er={},rr=Qe.LINE_SPACING;function nr(t,e){return t.node().getBoundingClientRect()[e]}var ir=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;er.convertToTspans=function(t,r,n){var i=t.text(),a=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&i.match(ir),o=e.select(t.node().parentNode);if(!o.empty()){var s=t.attr("class")?t.attr("class").split(" ")[0]:"text";return s+="-math",o.selectAll("svg."+s).remove(),o.selectAll("g."+s+"-group").remove(),t.style("display",null).attr({"data-unformatted":i,"data-math":"N"}),a?(r&&r._promises||[]).push(new Promise(function(r){t.style("display","none");var u=parseInt(t.node().style.fontSize,10),c={fontSize:u};!function(t,r,n){var i="math-output-"+ne.randstr([],64),a=e.select("body").append("div").attr({id:i}).style({visibility:"hidden",position:"absolute"}).style({"font-size":r.fontSize+"px"}).text((o=t,o.replace(ar,"\\lt ").replace(or,"\\gt ")));var o;MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var r=e.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())ne.log("There was an error in the tex syntax.",t),n();else{var i=a.select("svg").node().getBoundingClientRect();n(a.select(".MathJax_SVG"),r,i)}a.remove()})}(a[2],c,function(e,a,c){o.selectAll("svg."+s).remove(),o.selectAll("g."+s+"-group").remove();var h=e&&e.select("svg");if(!h||!h.node())return l(),void r();var f=o.append("g").classed(s+"-group",!0).attr({"pointer-events":"none","data-unformatted":i,"data-math":"Y"});f.node().appendChild(h.node()),a&&a.node()&&h.node().insertBefore(a.node().cloneNode(!0),h.node().firstChild),h.attr({class:s,height:c.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";h.select("g").attr({fill:p,stroke:p});var d=nr(h,"width"),g=nr(h,"height"),v=+t.attr("x")-d*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=-(u||nr(t,"height"))/4;"y"===s[0]?(f.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-d/2,m-g/2]+")"}),h.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===s[0]?h.attr({x:t.attr("x"),y:m-g/2}):"a"===s[0]?h.attr({x:0,y:m}):h.attr({x:v,y:+t.attr("y")+m-g/2}),n&&n.call(t,f),r(f)})})):l(),t}function l(){o.empty()||(s=t.attr("class")+"-math",o.select("svg."+s).remove()),t.text("").style("white-space","pre"),function(t,r){r=(n=r,function(t,e){if(!t)return"";for(var r=0;r1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",r),i=o[o.length-1].node}else ne.log("Ignoring unexpected end tag "+t+">.",r)}mr.test(r)?l():(i=t,o=[{node:t}]);for(var f=r.split(gr),p=0;p|>|>)/g;var sr={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},lr={sub:"0.3em",sup:"-0.6em"},ur={sub:"-0.21em",sup:"0.42em"},cr="\u200b",hr=["http:","https:","mailto:","",void 0,":"],fr=new RegExp("?("+Object.keys(sr).join("|")+")( [^>]*)?/?>","g"),pr=Object.keys(tr.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:tr.entityToUnicode[t]}}),dr=/(\r\n?|\n)/g,gr=/(<[^<>]*>)/,vr=/<(\/?)([^ >]*)(\s+(.*))?>/i,mr=/
/i,yr=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,xr=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,br=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_r=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function wr(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}var Mr=/(^|;)\s*color:/;function Ar(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}er.plainText=function(t){return(t||"").replace(fr," ")},er.lineCount=function(t){return t.selectAll("tspan.line").size()||1},er.positionText=function(t,r,n){return t.each(function(){var t=e.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",r),o=i("y",n);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},er.makeEditable=function(t,r){var n=r.gd,i=r.delegate,a=e.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){var i,s,u,c;i=e.select(n).select(".svg-container"),s=i.append("div"),u=t.node().style,c=parseFloat(u.fontSize||12),s.classed("plugin-editable editable",!0).style({position:"absolute","font-family":u.fontFamily||"Arial","font-size":c,color:r.fill||u.fill||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||t.attr("data-unformatted")).call(Ar(t,i,r)).on("blur",function(){n._editing=!1,t.text(this.textContent).style({opacity:1});var r,i=e.select(this).attr("class");(r=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&e.select(t.node().parentNode).select(r).style({opacity:0});var o=this.textContent;e.select(this).transition().duration(0).remove(),e.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;n._editing=!0,e.select(document).on("mouseup",function(){if(e.event.target===t)return!1;document.activeElement===s.node()&&s.node().blur()})}).on("keyup",function(){27===e.event.which?(n._editing=!1,t.style({opacity:1}),e.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),e.select(this).call(Ar(t,i,r)))}).on("keydown",function(){13===e.event.which&&this.blur()}).call(l),t.style({opacity:0});var h,f=o.attr("class");(h=f?"."+f.split(" ")[0]+"-math-group":"[class*=-math-group]")&&e.select(t.node().parentNode).select(h).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return r.immediate?s():o.on("click",s),e.rebind(t,a,"on")};var kr=function(t){var e=t.marker,n=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/n)}:function(t){return t/n};return function(t){var e=a(t/2);return r(e)&&e>0?Math.max(e,i):0}},Tr={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("markers")},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return ne.isPlainObject(t.marker)&&ne.isArrayOrTypedArray(t.marker.size)}},Sr={},Er=Qe.LINE_SPACING,Cr=f.DESELECTDIM,Lr=Sr={};Lr.font=function(t,e,r,n){ne.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(Oe.fill,n)},Lr.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},Lr.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},Lr.setRect=function(t,e,r,n,i){t.call(Lr.setPosition,e,r).call(Lr.setSize,n,i)},Lr.translatePoint=function(t,e,n,i){var a=n.c2p(t.x),o=i.c2p(t.y);return!!(r(a)&&r(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},Lr.translatePoints=function(t,r,n){t.each(function(t){var i=e.select(this);Lr.translatePoint(t,i,r,n)})},Lr.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},Lr.hideOutsideRangePoints=function(t,r,n){if(r._hasClipOnAxisFalse){n=n||".point,.textpoint";var i=r.xaxis,a=r.yaxis;t.each(function(r){var o=r[0].trace,s=o.xcalendar,l=o.ycalendar;t.selectAll(n).each(function(t){Lr.hideOutsideRangePoint(t,e.select(this),i,a,s,l)})})}},Lr.crispRound=function(t,e,n){return e&&r(e)?t._context.staticPlot?e:e<1?1:Math.round(e):n||0},Lr.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";Oe.stroke(e,n||a.color),Lr.dashLine(e,s,o)},Lr.lineGroupStyle=function(t,r,n,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";e.select(this).call(Oe.stroke,n||a.color).call(Lr.dashLine,s,o)})},Lr.dashLine=function(t,e,r){r=+r||0,e=Lr.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},Lr.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},Lr.singleFillStyle=function(t){var r=(((e.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;r&&t.call(Oe.fill,r)},Lr.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(r){var n=e.select(this);try{n.call(Oe.fill,r[0].trace.fillcolor)}catch(e){ne.error(e,t),n.remove()}})},Lr.symbolNames=[],Lr.symbolFuncs=[],Lr.symbolNeedLines={},Lr.symbolNoDot={},Lr.symbolNoFill={},Lr.symbolList=[],Object.keys(Ke).forEach(function(t){var e=Ke[t];Lr.symbolList=Lr.symbolList.concat([e.n,t,e.n+100,t+"-open"]),Lr.symbolNames[e.n]=t,Lr.symbolFuncs[e.n]=e.f,e.needLine&&(Lr.symbolNeedLines[e.n]=!0),e.noDot?Lr.symbolNoDot[e.n]=!0:Lr.symbolList=Lr.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(Lr.symbolNoFill[e.n]=!0)});var zr=Lr.symbolNames.length,Pr="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function Ir(t,e){var r=t%100;return Lr.symbolFuncs[r](e)+(t>=200?Pr:"")}Lr.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=Lr.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=zr||t>=400?0:Math.floor(Math.max(t,0))};var Dr={x1:1,x2:0,y1:0,y2:0},Or={x1:0,x2:0,y1:1,y2:0};Lr.gradient=function(t,r,n,i,a,o){var l=r._fullLayout._defs.select(".gradients").selectAll("#"+n).data([i+a+o],ne.identity);l.exit().remove(),l.enter().append("radial"===i?"radialGradient":"linearGradient").each(function(){var t=e.select(this);"horizontal"===i?t.attr(Dr):"vertical"===i&&t.attr(Or),t.attr("id",n);var r=s(a),l=s(o);t.append("stop").attr({offset:"0%","stop-color":Oe.tinyRGB(l),"stop-opacity":l.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":Oe.tinyRGB(r),"stop-opacity":r.getAlpha()})}),t.style({fill:"url(#"+n+")","fill-opacity":null})},Lr.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},Lr.singlePointStyle=function(t,e,r,n,i,a){var o=r.marker;!function(t,e,r,n,i,a,o,s){if(P.traceIs(r,"symbols")){var l=kr(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:Tr.isBubble(r)?l(t.ms):(a.size||6)/2,t.mrc=e;var n=Lr.symbolNumber(t.mx||a.symbol)||0;return t.om=n%200>=100,Ir(n,e)})}e.style("opacity",function(t){return(t.mo+1||a.opacity+1)-1});var u,c,h,f=!1;if(t.so?(h=o.outlierwidth,c=o.outliercolor,u=a.outliercolor):(h=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,c="mlc"in t?t.mlcc=i(t.mlc):ne.isArrayOrTypedArray(o.color)?Oe.defaultLine:o.color,ne.isArrayOrTypedArray(a.color)&&(u=Oe.defaultLine,f=!0),u="mc"in t?t.mcc=n(t.mc):a.color||"rgba(0,0,0,0)"),t.om)e.call(Oe.stroke,u).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",h+"px");var p=a.gradient,d=t.mgt;if(d?f=!0:d=p&&p.type,d&&"none"!==d){var g=t.mgc;g?f=!0:g=p.color;var v="g"+s._fullLayout._uid+"-"+r.uid;f&&(v+="-"+t.i),e.call(Lr.gradient,s,v,d,u,g)}else e.call(Oe.fill,u);h&&e.call(Oe.stroke,c)}}(t,e,r,n,i,o,o.line,a)},Lr.pointStyle=function(t,r,n){if(t.size()){var i=r.marker,a=Lr.tryColorscale(i,""),o=Lr.tryColorscale(i,"line");t.each(function(t){Lr.singlePointStyle(t,e.select(this),r,a,o,n)})}},Lr.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},o=n.marker||{},s=i.opacity,l=a.opacity,u=o.opacity,c=void 0!==l,h=void 0!==u;e.opacityFn=function(t){var e=t.mo,r=void 0!==e;if(r||c||h){if(!t.selected)return h?u:Cr*(r?e:s);if(c)return l}};var f=a.color,p=o.color;(f||p)&&(e.colorFn=function(t){if(t.selected){if(f)return f}else if(p)return p});var d=a.size,g=o.size,v=void 0!==d,m=void 0!==g;return(v||m)&&(e.sizeFn=function(t){var e=t.mrc;return t.selected?v?d/2:e:m?g/2:e}),e},Lr.selectedPointStyle=function(t,r){if(t.size()&&r.selectedpoints){var n=Lr.makeSelectedPointStyleFns(r),i=r.marker||{};t.each(function(t){var r=e.select(this),i=n.opacityFn(t);void 0!==i&&r.style("opacity",i)}),n.colorFn&&t.each(function(t){var r=e.select(this),i=n.colorFn(t);i&&Oe.fill(r,i)}),P.traceIs(r,"symbols")&&n.sizeFn&&t.each(function(t){var r=e.select(this),a=t.mx||i.symbol||0,o=n.sizeFn(t);r.attr("d",Ir(Lr.symbolNumber(a),o)),t.mrc2=o})}},Lr.tryColorscale=function(t,e){var r=e?ne.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&ne.isArrayOrTypedArray(i)?Je.makeColorScaleFunc(Je.extractScale(n,r.cmin,r.cmax)):ne.identity};var Rr={start:1,end:-1,middle:0,bottom:1,top:-1};function Fr(t,r,n,i){var a=e.select(t.node().parentNode),o=-1!==r.indexOf("top")?"top":-1!==r.indexOf("bottom")?"bottom":"middle",s=-1!==r.indexOf("left")?"end":-1!==r.indexOf("right")?"start":"middle",l=i?i/.8+1:0,u=(er.lineCount(t)-1)*Er+1,c=Rr[s]*l,h=.75*n+Rr[o]*l+(Rr[o]-1)*u*n/2;t.attr("text-anchor",s),a.attr("transform","translate("+c+","+h+")")}function Br(t,e){var n=t.ts||e.textfont.size;return r(n)&&n>0?n:0}Lr.textPointStyle=function(t,r,n){t.each(function(t){var i=e.select(this),a=ne.extractOption(t,r,"tx","text");if(a){var o=t.tp||r.textposition,s=Br(t,r);i.call(Lr.font,t.tf||r.textfont.family,s,t.tc||r.textfont.color).text(a).call(er.convertToTspans,n).call(Fr,o,s,t.mrc)}else i.remove()})},Lr.selectedTextStyle=function(t,r){if(t.size()&&r.selectedpoints){var n=r.selected||{},i=r.unselected||{};t.each(function(t){var a,o=e.select(this),s=t.tc||r.textfont.color,l=t.tp||r.textposition,u=Br(t,r),c=(n.textfont||{}).color,h=(i.textfont||{}).color;t.selected?c&&(a=c):h?a=h:c||(a=Oe.addOpacity(s,Cr)),a&&Oe.fill(o,a),Fr(o,l,u,t.mrc2||t.mrc)})}};var Nr=.5;function jr(t,r,n,i){var a=t[0]-r[0],o=t[1]-r[1],s=n[0]-r[0],l=n[1]-r[1],u=Math.pow(a*a+o*o,Nr/2),c=Math.pow(s*s+l*l,Nr/2),h=(c*c*a-u*u*s)*i,f=(c*c*o-u*u*l)*i,p=3*c*(u+c),d=3*u*(u+c);return[[e.round(r[0]+(p&&h/p),2),e.round(r[1]+(p&&f/p),2)],[e.round(r[0]-(d&&h/d),2),e.round(r[1]-(d&&f/d),2)]]}Lr.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(Lr.savedBBoxes={},qr=0),n&&(Lr.savedBBoxes[n]=d),qr++,ne.extendFlat({},d)},Lr.setClipUrl=function(t,r){if(r){var n="#"+r,i=e.select("base");i.size()&&i.attr("href")&&(n=window.location.href.split("#")[0]+n),t.attr("clip-path","url("+n+")")}else t.attr("clip-path",null)},Lr.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},Lr.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},Lr.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},Lr.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a},Lr.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var Gr=/translate\([^)]*\)\s*$/;Lr.setTextPointsScale=function(t,r,n){t.each(function(){var t,i=e.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(Gr);t=1===r&&1===n?[]:["translate("+o+","+s+")","scale("+r+","+n+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})};var Wr={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20},Yr=Ae.dash,Xr=m.extendFlat,Zr={x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:Xr({},Yr,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none",editType:"calc"},fillcolor:{valType:"color",editType:"style"},marker:Xr({symbol:{valType:"enumerated",values:Sr.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style"},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calcIfAutorange"},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:ze,line:Xr({width:{valType:"number",min:0,arrayOk:!0,editType:"style"},editType:"calc"},De()),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},De()),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:T({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}},Jr=Zr.marker,Kr={r:Zr.r,t:Zr.t,marker:{color:Jr.color,size:Jr.size,symbol:Jr.symbol,opacity:Jr.opacity,editType:"calc"}},Qr=m.extendFlat,$r=ye.overrideAll,tn=Qr({},Ce.domain,{});function en(t,e){return Qr({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}})}var rn=$r({radialaxis:en(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:tn,orientation:{valType:"number"}}),angularaxis:en(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:tn}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested"),nn={},an=ne.extendFlat,on=ne.extendDeepAll,sn="_isSubplotObj",ln="_isLinkedToArray",un=[sn,ln,"_arrayAttrRegexps","_deprecated"];function cn(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(hn(e[r]))r++;else if(r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!hn(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function hn(t){return t===Math.round(t)&&t>=0}function fn(t){return function(t){nn.crawl(t,function(t,e,r){nn.isValObject(t)?"data_array"===t.valType?(t.role="data",r[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(r[e+"src"]={valType:"string",editType:"none"}):ne.isPlainObject(t)&&(t.role="object")})}(t),function(t){nn.crawl(t,function(t,e,r){if(!t)return;var n=t[ln];if(!n)return;delete t[ln],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function pn(t,e,r){var n=ne.nestedProperty(t,r),i=on({},e.layoutAttributes);i[sn]=!0,n.set(i)}function dn(t,e,r){var n=ne.nestedProperty(t,r);n.set(on(n.get()||{},e))}nn.IS_SUBPLOT_OBJ=sn,nn.IS_LINKED_TO_ARRAY=ln,nn.DEPRECATED="_deprecated",nn.UNDERSCORE_ATTRS=un,nn.get=function(){var t={};P.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:Kr},r={}):(e=P.modules[t]._module,r=e.basePlotModule);var n={type:null};on(n,E),on(n,e.attributes),r.attributes&&on(n,r.attributes);n.type=t;var i={meta:e.meta||{},attributes:fn(n)};if(e.layoutAttributes){var a={};on(a,e.layoutAttributes),i.layoutAttributes=fn(a)}return i}(e)});var e,r={};return Object.keys(P.transformsRegistry).forEach(function(t){r[t]=function(t){var e=P.transformsRegistry[t],r=on({},e.attributes);return Object.keys(P.componentsRegistry).forEach(function(e){var n=P.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){dn(r,n.schema.transforms[t][e],e)})}),{attributes:fn(r)}}(t)}),{defs:{valObjects:ne.valObjectMeta,metaKeys:un.concat(["description","role","editType","impliedEdits"]),editType:{traces:ye.traces,layout:ye.layout},impliedEdits:{}},traces:t,layout:function(){var t,e,r={};for(t in on(r,z),P.subplotsRegistry)if((e=P.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)pn(r,e,"xaxis"),pn(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;pn(r,e,n)}for(t in r=function(t){return an(t,{radialaxis:rn.radialaxis,angularaxis:rn.angularaxis}),an(t,rn.layout),t}(r),P.componentsRegistry){var i=(e=P.componentsRegistry[t]).schema;if(i&&(i.subplots||i.layout)){var a=i.subplots;if(a&&a.xaxis&&!a.yaxis)for(var o in a.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&dn(r,e.layoutAttributes,e.name)}return{layoutAttributes:fn(r)}}(),transforms:r,frames:(e={frames:ne.extendDeepAll({},Me)},fn(e),e.frames),animation:fn(we)}},nn.crawl=function(t,e,r,n){var i=r||0;n=n||"",Object.keys(t).forEach(function(r){var a=t[r];if(-1===un.indexOf(r)){var o=(n?n+".":"")+r;e(a,r,t,i,o),nn.isValObject(a)||ne.isPlainObject(a)&&"impliedEdits"!==r&&nn.crawl(a,e,i+1,o)}})},nn.isValObject=function(t){return t&&void 0!==t.valType},nn.findArrayAttributes=function(t){var e=[],r=[];function n(n,i,a,o){if(r=r.slice(0,o).concat([i]),n&&("data_array"===n.valType||!0===n.arrayOk)&&!("colorbar"===r[o-1]&&("ticktext"===i||"tickvals"===i))){var s=function(t){return t.join(".")}(r),l=ne.nestedProperty(t,s).get();ne.isArrayOrTypedArray(l)&&e.push(s)}}if(nn.crawl(E,n),t._module&&t._module.attributes&&nn.crawl(t._module.attributes,n),t.transforms)for(var i=t.transforms,a=0;a=t.transforms.length)return!1;n=(r=(P.transformsRegistry[t.transforms[o].type]||{}).attributes)&&r[e[2]],a=3}else if("area"===t.type)n=Kr[i];else{var s=t._module;if(s||(s=(P.modules[t.type||E.type.dflt]||{})._module),!s)return!1;if(!(n=(r=s.attributes)&&r[i])){var l=s.basePlotModule;l&&l.attributes&&(n=l.attributes[i])}n||(n=E[i])}return cn(n,e,a)},nn.getLayoutValObject=function(t,e){return cn(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;rn?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},vn={};function mn(t,e,r){var n,i,a,o=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return i=ne.nestedProperty(n,e.prop).get(),(a=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&a[e.prop]!==i&&(o=!0),a[e.prop]=i,{changed:o,value:i}}function yn(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!ne.isPlainObject(n))return r;i=n}return bn(i,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function xn(t,e){var r,n,i,a,o=[];if(n=e[0],i=e[1],r=e[2],a={},"string"==typeof n)a[n]=i;else{if(!ne.isPlainObject(n))return o;a=n,void 0===r&&(r=i)}return void 0===r&&(r=null),bn(a,function(e,n,i){var a;if(Array.isArray(i)){var s=Math.min(i.length,t.data.length);r&&(s=Math.min(s,r.length)),a=[];for(var l=0;l0?".":"")+i;ne.isPlainObject(a)?bn(a,e,o,n+1):e(o,i,a)}})}vn.manageCommandObserver=function(t,e,r,n){var i={},a=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var o=vn.hasSimpleAPICommandBindings(t,r,i.lookupTable);if(e&&e._commandObserver){if(o)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(o){mn(t,o,i.cache),i.check=function(){if(a){var e=mn(t,o,i.cache);return e.changed&&n&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(n({value:e.value,type:o.type,prop:o.prop,traces:o.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var s=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],l=0;l=r.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=r._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){An.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},An.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var r=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",n=e.select(t).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:r+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=An.graphJson(t,!1,"keepdata"),i.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1};var Sn,En=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],Cn=["year","month","dayMonth","dayMonthYear"];function Ln(t,e){var r,n,i=t.trace,a=i._arrayAttrs,o={};for(r=0;r=0)return!0}return!1},An.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var u=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),c=u.left+u.right,h=u.bottom+u.top,f=1-2*s,p=n._container&&n._container.node?n._container.node().getBoundingClientRect():{width:n.width,height:n.height};i=Math.round(f*(p.width-c)),a=Math.round(f*(p.height-h))}else{var d=l?window.getComputedStyle(t):{};i=parseFloat(d.width)||n.width,a=parseFloat(d.height)||n.height}var g=An.layoutAttributes.width.min,v=An.layoutAttributes.height.min;i1,y=!e.height&&Math.abs(n.height-a)>1;(y||m)&&(m&&(n.width=i),y&&(n.height=a)),t._initialAutoSize||(t._initialAutoSize={width:i,height:a}),An.sanitizeMargins(n)},An.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=P.componentsRegistry,l=e._basePlotModules,u=P.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var c in l.length||l.push(u),e._has("cartesian")&&(P.getComponentMethod("grid","contentDefaults")(t,e),u.finalizeSubplots(t,e)),e._subplots)e._subplots[c].sort(ne.subplotSort);for(a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||An.doAutoMargin(t)}},An.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var n=e._size,i=JSON.stringify(n),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),s=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand)for(var c in u.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:s},b:{val:0,size:l}},u){var h=u[c].l||{},f=u[c].b||{},p=h.val,d=h.size,g=f.val,v=f.size;for(var m in u){if(r(d)&&u[m].r){var y=u[m].r.val,x=u[m].r.size;if(y>p){var b=(d*y+(x-e.width)*p)/(y-p),_=(x*(1-p)+(d-e.width)*(1-y))/(y-p);b>=0&&_>=0&&b+_>a+o&&(a=b,o=_)}}if(r(v)&&u[m].t){var w=u[m].t.val,M=u[m].t.size;if(w>g){var A=(v*w+(M-e.height)*g)/(w-g),k=(M*(1-g)+(v-e.height)*(1-w))/(w-g);A>=0&&k>=0&&A+k>l+s&&(l=A,s=k)}}}}if(n.l=Math.round(a),n.r=Math.round(o),n.t=Math.round(s),n.b=Math.round(l),n.p=Math.round(e.margin.pad),n.w=Math.round(e.width)-n.l-n.r,n.h=Math.round(e.height)-n.t-n.b,!e._replotting&&"{}"!==i&&i!==JSON.stringify(e._size))return P.call("plot",t)},An.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&An.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function l(t){if("function"==typeof t)return null;if(ne.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!ne.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=l(t[e])}return i}return Array.isArray(t)?t.map(l):ne.isJSDate(t)?ne.ms2DateTimeLocal(+t):t}var u={data:(a||[]).map(function(t){var r=l(t);return e&&delete r.fit,r})};return e||(u.layout=l(o)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),s&&(u.frames=l(s)),"object"===n?u:JSON.stringify(u)},An.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){h=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return P.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var n,o,s=0,l=0;function u(){return s++,function(){var r;h||++l!==s||(r=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return P.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(r)))}}var f=t._fullLayout._basePlotModules,p=!1;if(r)for(o=0;o=0;a--)if(g[a].enabled){r._indexToPoints=g[a]._indexToPoints;break}n&&n.calc&&(d=n.calc(t,r))}Array.isArray(d)&&d[0]||(d=[{x:Mn,y:Mn}]),d[0].t||(d[0].t={}),d[0].trace=r,u[i]=d}P.getComponentMethod("fx","calc")(t)},An.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},An.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i0||h<0){var d={left:[-i,0],right:[i,0],top:[0,-i],bottom:[0,i]}[c.side];n.attr("transform","translate("+d+")")}}}k.call(T),M&&(w?k.on(".opacity",null):(b=0,_=!0,k.text(l).on("mouseover.opacity",function(){e.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){e.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),k.call(er.makeEditable,{gd:t}).on("edit",function(e){void 0!==u?P.call("restyle",t,s,e,u):P.call("relayout",t,s,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(T)}).on("input",function(t){this.text(t||" ").call(er.positionText,h.x,h.y)}));return k.classed("js-placeholder",_),d}},On=/ [XY][0-9]* /;var Rn=t.FP_SAFE,Fn=Vn,Bn=Un,Nn=function(t){t._length||t.setScale();var e,r=t._min&&t._max&&t._min.length&&t._max.length;t.autorange&&r&&(t.range=Vn(t),t._r=t.range.slice(),t._rl=ne.simpleMap(t._r,t.r2l),(e=t._input).range=t.range.slice(),e.autorange=t.autorange);if(t._anchorAxis&&t._anchorAxis.rangeslider){var n=t._anchorAxis.rangeslider[t._name];n&&"auto"===n.rangemode&&(n.range=r?Vn(t):t._rangeInitial?t._rangeInitial.slice():t.range.slice()),(e=t._anchorAxis._input).rangeslider[t._name]=ne.extendFlat({},n)}},jn=function(t,e,n){if(!function(t){return t.autorange||t._rangesliderAutorange}(t)||!e)return;t._min||(t._min=[]);t._max||(t._max=[]);n||(n={});t._m||t.setScale();var i,a,o,s,l,u,c,h,f,p,d,g,v=e.length,m=n.padded||!1,y=n.tozero&&("linear"===t.type||"-"===t.type),x="log"===t.type,b=!1;function _(t){if(Array.isArray(t))return b=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var w=_((t._m>0?n.ppadplus:n.ppadminus)||n.ppad||0),M=_((t._m>0?n.ppadminus:n.ppadplus)||n.ppad||0),A=_(n.vpadplus||n.vpad),k=_(n.vpadminus||n.vpad);if(!b){if(d=1/0,g=-1/0,x)for(i=0;i0&&(d=s),s>g&&s-Rn&&(d=s),s>g&&s=b&&(s.extrapad||!m)){p=!1;break}_(i,s.val)&&s.pad<=b&&(m||!s.extrapad)&&(v.splice(a,1),a--)}if(p){var T=y&&0===i;v.push({val:i,pad:T?0:b,extrapad:!T&&m})}}}}var S=Math.min(6,v);for(i=0;i=S;i--)T(i)};function Vn(t){var e,r,n,i,a,o,s,l,u=[],c=t._min[0].val,h=t._max[0].val,f=0,p=!1,d=Un(t);for(e=1;e0&&s>0&&l/s>f&&(a=n,o=i,f=l/s);if(c===h){var v=c-1,m=c+1;u="tozero"===t.rangemode?c<0?[v,0]:[0,m]:"nonnegative"===t.rangemode?[Math.max(0,v),Math.max(0,m)]:[v,m]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(a.val>=0&&(a={val:0,pad:0}),o.val<=0&&(o={val:0,pad:0})):"nonnegative"===t.rangemode&&(a.val-f*d(a)<0&&(a={val:0,pad:0}),o.val<0&&(o={val:1,pad:0})),f=(o.val-a.val)/(t._length-d(a)-d(o))),u=[a.val-f*d(a),o.val+f*d(o)]);return u[0]===u[1]&&("tozero"===t.rangemode?u=u[0]<0?[u[0],0]:u[0]>0?[0,u[0]]:[0,1]:(u=[u[0]-1,u[0]+1],"nonnegative"===t.rangemode&&(u[0]=Math.max(0,u[0])))),p&&u.reverse(),ne.simpleMap(u,t.l2r||Number)}function Un(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function qn(t){return r(t)&&Math.abs(t)=e}var Wn=t.BADNUM,Yn=function(t,e){return function(t,e){for(var n,i=0,a=0,o=Math.max(1,(t.length-1)/1e3),s=0;s2*a}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;e0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*a*Math.abs(n-i))}return $n}function s(e,n,i){var a=Jn(e,i||t.calendar);if(a===$n){if(!r(e))return $n;a=Jn(new Date(+e))}return a}function l(e,r,n){return Zn(e,r,n||t.calendar)}function u(e){return t._categories[Math.round(e)]}function c(e){if(t._categoriesMap){var n=t._categoriesMap[e];if(void 0!==n)return n}if(r(e))return+e}function h(n){return r(n)?e.round(t._b+t._m*n,2):$n}function f(e){return(e-t._b)/t._m}t.c2l="log"===t.type?o:Kn,t.l2c="log"===t.type?ti:Kn,t.l2p=h,t.p2l=f,t.c2p="log"===t.type?function(t,e){return h(o(t,e))}:h,t.p2c="log"===t.type?function(t){return ti(f(t))}:f,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=Xn,t.c2d=t.c2r=t.l2d=t.l2r=Kn,t.d2p=t.r2p=function(e){return t.l2p(Xn(e))},t.p2d=t.p2r=f,t.cleanPos=Kn):"log"===t.type?(t.d2r=t.d2l=function(t,e){return o(Xn(t),e)},t.r2d=t.r2c=function(t){return ti(Xn(t))},t.d2c=t.r2l=Xn,t.c2d=t.l2r=Kn,t.c2r=o,t.l2d=ti,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return ti(f(t))},t.r2p=function(e){return t.l2p(Xn(e))},t.p2r=f,t.cleanPos=Kn):"date"===t.type?(t.d2r=t.r2d=ne.identity,t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=l,t.d2p=t.r2p=function(e,r,n){return t.l2p(s(e,0,n))},t.p2d=t.p2r=function(t,e,r){return l(f(t),e,r)},t.cleanPos=function(e){return ne.cleanDate(e,$n,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return $n},t.r2d=t.c2d=t.l2d=u,t.d2r=t.d2l_noadd=c,t.r2c=function(e){var r=c(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=Kn,t.r2l=c,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return u(f(t))},t.r2p=t.d2p,t.p2r=f,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:Kn(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,n){n||(n={}),e||(e="range");var a,o,s=ne.nestedProperty(t,e).get();if(o=(o="date"===t.type?ne.dfltRange(t.calendar):"y"===i?Te.DFLTRANGEY:n.dfltRange||Te.DFLTRANGEX).slice(),s&&2===s.length)for("date"===t.type&&(s[0]=ne.cleanDate(s[0],$n,t.calendar),s[1]=ne.cleanDate(s[1],$n,t.calendar)),a=0;a<2;a++)if("date"===t.type){if(!ne.isDateTime(s[a],t.calendar)){t[e]=o;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=ne.constrain(t.r2l(s[0]),ne.MIN_MS+1e3,ne.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!r(s[a])){if(!r(s[1-a])){t[e]=o;break}s[a]=s[1-a]*(a?10:.1)}if(s[a]<-Qn?s[a]=-Qn:s[a]>Qn&&(s[a]=Qn),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else ne.nestedProperty(t,e).set(o)},t.setScale=function(e){var r=n._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=gn.getFromId({_fullLayout:n},t.overlaying);t.domain=a.domain}var o=e&&t._r?"_r":"range",s=t.calendar;t.cleanRange(o);var l=t.r2l(t[o][0],s),u=t.r2l(t[o][1],s);if("y"===i?(t._offset=r.t+(1-t.domain[1])*r.h,t._length=r.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=r.l+t.domain[0]*r.w,t._length=r.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw n._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o,s=t.type,l="date"===s&&e[r+"calendar"];if(r in e){if(n=e[r],o=e._length||n.length,ne.isTypedArray(n)&&("linear"===s||"log"===s)){if(o===n.length)return n;if(n.subarray)return n.subarray(0,o)}for(i=new Array(o),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t.clearCalc=function(){t._min=[],t._max=[],t._categories=(t._initialCategories||[]).slice(),t._categoriesMap={};for(var e=0;e2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},pi.saveRangeInitial=function(t,e){for(var r=pi.list(t,"",!0),n=!1,i=0;i.3*f||c(i)||c(a))){var p=n.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=pi.tickIncrement(t,"M6","reverse")+1.5*ai:a.exactMonths>.8?t=pi.tickIncrement(t,"M1","reverse")+15.5*ai:t-=ai/2;var s=pi.tickIncrement(t,r);if(s<=n)return s}return t}(d,t,s.dtick,l,a)),p=d,0;p<=u;)p=pi.tickIncrement(p,s.dtick,!1,a),0;return{start:e.c2r(d,0,a),end:e.c2r(p,0,a),size:s.dtick,_dataSpan:u-l}},pi.prepTicks=function(t){var e=ne.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=ne.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),pi.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),ki(t)},pi.calcTicks=function(t){pi.prepTicks(t);var e=ne.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=ne.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],l=1.0001*o[1]-1e-4*o[0],u=Math.min(s,l),c=Math.max(s,l),h=0;Array.isArray(i)||(i=[]);var f="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(r=0;ru&&e=n:l<=n)&&!(a.length>s||l===o);l=pi.tickIncrement(l,t.dtick,i,t.calendar))o=l,a.push(l);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(a.length),c=0;c10||"01-01"!==i.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=ai&&a<=10||e>=15*ai)t._tickround="d";else if(e>=si&&a<=16||e>=oi)t._tickround="M";else if(e>=li&&a<=19||e>=si)t._tickround="S";else{var o=t.l2r(n+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(r(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);r(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(Ei(t.exponentformat)&&!Ci(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function Ti(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}pi.autoTicks=function(t,e){var n;function i(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=ne.dateTick0(t.calendar);var a=2*e;a>ni?(e/=ni,n=i(10),t.dtick="M"+12*Ai(e,n,mi)):a>ii?(e/=ii,t.dtick="M"+Ai(e,1,yi)):a>ai?(t.dtick=Ai(e,ai,bi),t.tick0=ne.dateTick0(t.calendar,!0)):a>oi?t.dtick=Ai(e,oi,yi):a>si?t.dtick=Ai(e,si,xi):a>li?t.dtick=Ai(e,li,xi):(n=i(10),t.dtick=Ai(e,n,mi))}else if("log"===t.type){t.tick0=0;var o=ne.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,n=i(10),t.dtick="L"+Ai(e,n,mi)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=Ai(e,n,Mi)):(t.tick0=0,n=i(10),t.dtick=Ai(e,n,mi));if(0===t.dtick&&(t.dtick=1),!r(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},pi.tickIncrement=function(t,n,i,a){var o=i?-1:1;if(r(n))return t+o*n;var s=n.charAt(0),l=o*Number(n.substr(1));if("M"===s)return ne.incrementMonth(t,l,a);if("L"===s)return Math.log(Math.pow(10,t)+l)/Math.LN10;if("D"===s){var u="D2"===n?wi:_i,c=t+.01*o,h=ne.roundUp(ne.mod(c,1),u,i);return Math.floor(c)+Math.log(e.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(n)},pi.tickFirst=function(t){var n=t.r2l||Number,i=ne.simpleMap(t.range,n),a=i[1]"+s,t._prevDateHead=s));e.text=l}(t,o,n,l):"log"===t.type?function(t,e,n,i,a){var o=t.dtick,s=e.x,l=t.tickformat;"never"===a&&(a="");!i||"string"==typeof o&&"L"===o.charAt(0)||(o="L3");if(l||"string"==typeof o&&"L"===o.charAt(0))e.text=Li(Math.pow(10,s),t,a,i);else if(r(o)||"D"===o.charAt(0)&&ne.mod(s+.01,1)<.1){var u=Math.round(s);-1!==["e","E","power"].indexOf(t.exponentformat)||Ei(t.exponentformat)&&Ci(u)?(e.text=0===u?1:1===u?"10":u>1?"10"+u+"":"10"+ui+-u+"",e.fontSize*=1.25):(e.text=Li(Math.pow(10,s),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,ne.mod(s,1)))),e.fontSize*=.75}if("D1"===t.dtick){var c=String(e.text).charAt(0);"0"!==c&&"1"!==c||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(s<0?.5:.25)))}}(t,o,0,l,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"angular"===t._id?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=Li(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=Li(ne.deg2rad(e.x),t,i,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(e.text=ui+e.text)}}}}(t,o,n,l,i):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=Li(e.x,t,i,n)}(t,o,0,l,i),t.tickprefix&&!f(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!f(t.showticksuffix)&&(o.text+=t.ticksuffix),o},pi.hoverLabelText=function(t,e,r){if(r!==ci&&r!==e)return pi.hoverLabelText(t,e)+" - "+pi.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=pi.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":ui+i:i};var Si=["f","p","n","\u03bc","m","","k","M","G","T"];function Ei(t){return"SI"===t||"B"===t}function Ci(t){return t>14||t<-15}function Li(t,e,n,i){var a=t<0,o=e._tickround,s=n||e.exponentformat||"B",l=e._tickexponent,u=pi.getTickFormat(e),c=e.separatethousands;if(i){var h={exponentformat:s,dtick:"none"===e.showexponent?e.dtick:r(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ki(h),o=(Number(h._tickround)||0)+4,l=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,ui);var f,p=Math.pow(10,-o)/2;if("none"===s&&(l=0),(t=Math.abs(t))"+f+"":"B"===s&&9===l?t+="B":Ei(s)&&(t+=Si[l/3+5]));return a?ui+t:t}function zi(t,e){for(var r=0;r=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=a(n))){r=t.tickformatstops[e];break}break;case"log":for(e=0;e1&&e1)for(n=1;na&&(a=u,o=l)}}return a?i(o):Fi};case"rms":return function(t,e){for(var r=0,a=0,o=0;o0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}},Yi=s.mix,Xi=C.lightFraction,Zi=function(t,e,r,n){var i=(n=n||{}).dfltColor;function a(r,i){return ne.coerce2(t,e,n.attributes,r,i)}var o=a("linecolor",i),s=a("linewidth");r("showline",n.showLine||!!o||!!s)||(delete e.linecolor,delete e.linewidth);var l=a("gridcolor",Yi(i,n.bgColor,n.blend||Xi).toRgbString()),u=a("gridwidth");if(r("showgrid",n.showGrid||!!l||!!u)||(delete e.gridcolor,delete e.gridwidth),!n.noZeroLine){var c=a("zerolinecolor",i),h=a("zerolinewidth");r("zeroline",n.showGrid||!!c||!!h)||(delete e.zerolinecolor,delete e.zerolinewidth)}};function Ji(t,r,n){var i,a,o,s,l,u=[],c=n.map(function(e){return e[t]}),h=e.bisector(r).left;for(i=0;id[1]-.01&&(e.domain=o),ne.noneOrAll(t.domain,e.domain,o)}return n("layer"),e},ra=gn.name2id,na=function(t,e,r,n,i){i&&(e._name=i,e._id=ra(i)),"-"===r("type")&&(!function(t,e){if("-"!==t.type)return;var r=t._id,n=r.charAt(0);-1!==r.indexOf("scene")&&(r=n);var i=function(t,e,r){for(var n=0;n rect").call(Sr.setTranslate,0,0).call(Sr.setScale,1,1),t.plot.call(Sr.setTranslate,e._offset,r._offset).call(Sr.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(Sr.setPointGroupScale,1,1),n.selectAll(".textpoint").call(Sr.setTextPointsScale,1,1),n.call(Sr.hideOutsideRangePoints,t)}function g(e,r){var n,i,o,s=h[e.xaxis._id],l=h[e.yaxis._id],u=[];if(s){i=(n=t._fullLayout[s.axisName])._r,o=s.to,u[0]=(i[0]*(1-r)+r*o[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var c=i[1]-i[0],f=o[1]-o[0];n.range[0]=i[0]*(1-r)+r*o[0],n.range[1]=i[1]*(1-r)+r*o[1],u[2]=e.xaxis._length*(1-r+r*f/c)}else u[0]=0,u[2]=e.xaxis._length;if(l){i=(n=t._fullLayout[l.axisName])._r,o=l.to,u[1]=(i[1]*(1-r)+r*o[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var p=i[1]-i[0],d=o[1]-o[0];n.range[0]=i[0]*(1-r)+r*o[0],n.range[1]=i[1]*(1-r)+r*o[1],u[3]=e.yaxis._length*(1-r+r*d/p)}else u[1]=0,u[3]=e.yaxis._length;!function(e,r){var n,i=[];for(i=[e._id,r._id],n=0;n rect").call(Sr.setTranslate,_,w).call(Sr.setScale,1/x,1/b),e.plot.call(Sr.setTranslate,k,T).call(Sr.setScale,x,b).selectAll(".points").selectAll(".point").call(Sr.setPointGroupScale,1/x,1/b),e.plot.selectAll(".points").selectAll(".textpoint").call(Sr.setTextPointsScale,1/x,1/b)}i&&(s=i());var v=e.ease(n.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(c),c=null,function(){for(var e={},r=0;rn.duration?(function(){for(var e={},r=0;r0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},Ia.prototype.on=Ia.prototype.addListener,Ia.prototype.once=function(t,e){if(!Oa(e))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},Ia.prototype.removeListener=function(t,e){var r,n,i,a;if(!Oa(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(i=(r=this._events[t]).length,n=-1,r===e||Oa(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(Ra(r)){for(a=i;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},Ia.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(Oa(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},Ia.prototype.listeners=function(t){return this._events&&this._events[t]?Oa(this._events[t])?[this._events[t]]:this._events[t].slice():[]},Ia.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(Oa(e))return 1;if(e)return e.length}return 0},Ia.listenerCount=function(t,e){return t.listenerCount(e)};var Ba,Na=Da.EventEmitter,ja={init:function(t){if(t._ev instanceof Na)return t;var e=new Na,r=new Na;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,i){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;l4/3-s?o:s},qa.getCursor=function(t,e,r,n){return t="left"===r?0:"center"===r?1:"right"===r?2:ne.constrain(Math.floor(3*t),0,2),e="bottom"===n?0:"middle"===n?1:"top"===n?2:ne.constrain(Math.floor(3*e),0,2),za[e][t]},qa.unhover=Ba.wrapped,qa.unhoverRaw=Ba.raw,qa.init=function(t){var e,r,n,i,a,o,s,l,u=t.gd,c=1,h=f.DBLCLICKDELAY,p=t.element;u._mouseDownTime||(u._mouseDownTime=0),p.style.pointerEvents="all",p.onmousedown=g,Ea?(p._ontouchstart&&p.removeEventListener("touchstart",p._ontouchstart),p._ontouchstart=g,p.addEventListener("touchstart",g,{passive:!1})):p.ontouchstart=g;var d=t.clampFn||function(t,e,r){return Math.abs(t)h&&(c=Math.max(c-1,1)),u._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(c,o),!l){var r;try{r=new MouseEvent("click",e)}catch(t){var n=Ga(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}s.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&P.call("plot",t)}(u),u._dragged=!1}else u._dragged=!1}},qa.coverSlip=Ha;function Wa(t,e,r,n){n=n||ne.identity,Array.isArray(t)&&(e[0][r]=n(t))}var Ya={getSubplot:function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},flat:function(t,e){for(var r=new Array(t.length),n=0;n=0&&r.index-1&&s.length>d&&(s=d>3?s.substr(0,d-3)+"...":s.substr(0,d))}void 0!==t.extraText&&(l+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),l+=(l?"z: ":"")+t.zLabel):w&&t[i+"Label"]===v?l=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(l+=(l?"
":"")+t.text),""===l&&(""===s&&r.remove(),l=s);var g=r.select("text.nums").call(Sr.font,t.fontFamily||c,t.fontSize||h,t.fontColor||p).text(l).attr("data-notex",1).call(er.positionText,0,0).call(er.convertToTspans,n),m=r.select("text.name"),y=0;s&&s!==l?(m.call(Sr.font,t.fontFamily||c,t.fontSize||h,f).text(s).attr("data-notex",1).call(er.positionText,0,0).call(er.convertToTspans,n),y=m.node().getBoundingClientRect().width+2*so):(m.remove(),r.select("rect").remove()),r.select("path").style({fill:f,stroke:p});var M,A,k=g.node().getBoundingClientRect(),T=t.xa._offset+(t.x0+t.x1)/2,S=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),C=Math.abs(t.y1-t.y0),L=k.width+oo+so+y;t.ty0=x-k.top,t.bx=k.width+2*so,t.by=k.height+2*so,t.anchor="start",t.txwidth=k.width,t.tx2width=y,t.offset=0,a?(t.pos=T,M=S+C/2+L<=_,A=S-C/2-L>=0,"top"!==t.idealAlign&&M||!A?M?(S+=C/2,t.anchor="start"):t.anchor="middle":(S-=C/2,t.anchor="end")):(t.pos=S,M=T+E/2+L<=b,A=T-E/2-L>=0,"left"!==t.idealAlign&&M||!A?M?(T+=E/2,t.anchor="start"):t.anchor="middle":(T-=E/2,t.anchor="end")),g.attr("text-anchor",t.anchor),y&&m.attr("text-anchor",t.anchor),r.attr("transform","translate("+T+","+S+")"+(a?"rotate("+eo+")":""))}),E}function uo(t,r){t.each(function(t){var n=e.select(this);if(t.del)n.remove();else{var i="end"===t.anchor?-1:1,a=n.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],s=o*(oo+so),l=s+o*(t.txwidth+so),u=0,c=t.offset;"middle"===t.anchor&&(s-=t.tx2width/2,l+=t.txwidth/2+so),r&&(c*=-ao,u=t.offset*io),n.select("path").attr("d","middle"===t.anchor?"M-"+(t.bx/2+t.tx2width/2)+","+(c-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(i*oo+u)+","+(oo+c)+"v"+(t.by/2-oo)+"h"+i*t.bx+"v-"+t.by+"H"+(i*oo+u)+"V"+(c-oo)+"Z"),a.call(er.positionText,s+u,c+t.ty0-t.by/2+so),t.tx2width&&(n.select("text.name").call(er.positionText,l+o*so+u,c+t.ty0-t.by/2+so),n.select("rect").call(Sr.setRect,l+(o-1)*t.tx2width/2+u,c-t.by/2-1,t.tx2width,t.by+2))}})}function co(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],a=t.cd[r]||{},o=Array.isArray(r)?function(t,e){return ne.castOption(i,r,t)||ne.extractOption({},n,"",e)}:function(t,e){return ne.extractOption(a,n,t,e)};function s(e,r,n){var i=o(r,n);i&&(t[e]=i)}if(s("hoverinfo","hi","hoverinfo"),s("color","hbg","hoverlabel.bgcolor"),s("borderColor","hbc","hoverlabel.bordercolor"),s("fontFamily","htf","hoverlabel.font.family"),s("fontSize","hts","hoverlabel.font.size"),s("fontColor","htc","hoverlabel.font.color"),s("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=ne.constrain(t.x0,0,t.xa._length),t.x1=ne.constrain(t.x1,0,t.xa._length),t.y0=ne.constrain(t.y0,0,t.ya._length),t.y1=ne.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:ri.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:ri.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var l=ri.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+l+" / -"+ri.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+l,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=ri.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+ri.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var c=t.hoverinfo||t.trace.hoverinfo;return"all"!==c&&(-1===(c=Array.isArray(c)?c:c.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===c.indexOf("y")&&(t.yLabel=void 0),-1===c.indexOf("z")&&(t.zLabel=void 0),-1===c.indexOf("text")&&(t.text=void 0),-1===c.indexOf("name")&&(t.name=void 0)),t}function ho(t,e){var r,n,i=e.container,a=e.fullLayout,o=e.event,l=!!t.hLinePoint,u=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),u||l){var c=Oe.combine(a.plot_bgcolor,a.paper_bgcolor);if(l){var h,f,p=t.hLinePoint;r=p&&p.xa,"cursor"===(n=p&&p.ya).spikesnap?(h=o.pointerX,f=o.pointerY):(h=r._offset+p.x,f=n._offset+p.y);var d,g,v=s.readability(p.color,c)<1.5?Oe.contrast(c):p.color,m=n.spikemode,y=n.spikethickness,x=n.spikecolor||v,b=n._boundingBox,_=(b.left+b.right)/2q.width||V<0||V>q.height)return Ua.unhoverRaw(t,n);n.pointerX=n.offsetX,n.pointerY=n.offsetY}if(_="xval"in n?Ya.flat(o,n.xval):Ya.p2c(p,j),w="yval"in n?Ya.flat(o,n.yval):Ya.p2c(d,V),!r(_[0])||!r(w[0]))return ne.warn("Fx.hover failed",n,t),Ua.unhoverRaw(t,n)}var H=1/0;for(A=0;AD&&(F.splice(0,D),H=F[0].distance),c&&0!==R&&0===F.length){I.distance=R,I.index=!1;var Z=T._module.hoverPoints(I,L,z,"closest",s._hoverlayer);if(Z&&(Z=Z.filter(function(t){return t.spikeDistance<=R})),Z&&Z.length){var J,K=Z.filter(function(t){return t.xa.showspikes});if(K.length){var Q=K[0];r(Q.x0)&&r(Q.y0)&&(J=rt(Q),(!N.vLinePoint||N.vLinePoint.spikeDistance>J.spikeDistance)&&(N.vLinePoint=J))}var $=Z.filter(function(t){return t.ya.showspikes});if($.length){var tt=$[0];r(tt.x0)&&r(tt.y0)&&(J=rt(tt),(!N.hLinePoint||N.hLinePoint.spikeDistance>J.spikeDistance)&&(N.hLinePoint=J))}}}}function et(t,e){for(var r,n=null,i=1/0,a=0;a1,gt=Oe.combine(s.plot_bgcolor||Oe.background,s.paper_bgcolor),vt={hovermode:b,rotateLabels:dt,bgColor:gt,container:s._hoverlayer,outerContainer:s._paperdiv,commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance},mt=lo(F,vt,t);if(function(t,e,r){var n,i,a,o,s,l,u,c=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?no:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function f(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(;!n&&c<=t.length;){for(c++,n=!0,o=0;o.01&&g.pmin===v.pmin&&g.pmax===v.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(p.push.apply(p,d),h.splice(o+1,1),u=0,s=p.length-1;s>=0;s--)u+=p[s].dp;for(a=u/p.length,s=p.length-1;s>=0;s--)p[s].dp-=a;n=!1}else o++}h.forEach(f)}for(o=h.length-1;o>=0;o--){var m=h[o];for(s=m.length-1;s>=0;s--){var y=m[s],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(F,dt?"xa":"ya",s),uo(mt,dt),n.target&&n.target.tagName){var yt=P.getComponentMethod("annotations","hasClickToShow")(t,ft);$a(e.select(n.target),yt?"pointer":"")}if(!n.target||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,ht))return;ht&&t.emit("plotly_unhover",{event:n,points:ht});t.emit("plotly_hover",{event:n,points:t._hoverdata,xaxes:p,yaxes:d,xvals:_,yvals:w})}(t,n,i,a)})},to.loneHover=function(t,r){var n={color:t.color||Oe.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},i=e.select(r.container),a=r.outerContainer?e.select(r.outerContainer):i,o={hovermode:"closest",rotateLabels:!1,bgColor:r.bgColor||Oe.background,container:i,outerContainer:a},s=lo([n],o,r.gd);return uo(s,o.rotateLabels),s.node()};var po=to.hover,go=function(t,e,r,n){r("hoverlabel.bgcolor",(n=n||{}).bgcolor),r("hoverlabel.bordercolor",n.bordercolor),r("hoverlabel.namelength",n.namelength),ne.coerceFont(r,"hoverlabel.font",n.font)},vo=T({editType:"none"});vo.family.dflt=Pa.HOVERFONT,vo.size.dflt=Pa.HOVERFONTSIZE;var mo={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:vo,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}};var yo={moduleType:"component",name:"fx",constants:Pa,schema:{layout:mo},attributes:S,layoutAttributes:mo,supplyLayoutGlobalDefaults:function(t,e){go(0,0,function(r,n){return ne.coerce(t,e,mo,r,n)})},supplyDefaults:function(t,e,r,n){go(0,0,function(r,n){return ne.coerce(t,e,S,r,n)},n.hoverlabel)},supplyLayoutDefaults:function(t,e,r){function n(r,n){return ne.coerce(t,e,mo,r,n)}var i;n("dragmode"),e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,r=0;r.01?k:function(t,e){return Math.abs(t-e)>=2?k(t):t>e?Math.ceil(t):Math.floor(t)};d=M(d,p=M(p,d)),v=M(v,g=M(g,v))}var A=e.select(this);A.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+d+"V"+g+"Z").call(Sr.setClipUrl,n.layerClipId),function(t,e,r,n,i,a,o,s){var l;function u(e,r,n){var i=e.append("text").text(r).attr({class:"bartext bartext-"+l,transform:"","text-anchor":"middle","data-notex":1}).call(Sr.font,n).call(er.convertToTspans,t);return i}var c=r[0].trace,h=c.orientation,f=function(t,e){var r=Io(t.text,e);return Do(Ao,r)}(c,n);if(!f)return;if("none"===(l=function(t,e){var r=Io(t.textposition,e);return function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt}(ko,r)}(c,n)))return;var p,d,g,v,m,y,x=function(t,e,r){return Po(To,t.textfont,e,r)}(c,n,t._fullLayout.font),b=function(t,e,r){return Po(So,t.insidetextfont,e,r)}(c,n,x),_=function(t,e,r){return Po(Eo,t.outsidetextfont,e,r)}(c,n,x),w=t._fullLayout.barmode,M="stack"===w||"relative"===w,A=r[n],k=!M||A._outmost,T=Math.abs(a-i)-2*Co,S=Math.abs(s-o)-2*Co;"outside"===l&&(k||(l="inside"));if("auto"===l)if(k){l="inside",p=u(e,f,b),d=Sr.bBox(p.node()),g=d.width,v=d.height;var E=g>0&&v>0,C=g<=T&&v<=S,L=g<=S&&v<=T,z="h"===h?T>=g*(S/v):S>=v*(T/g);E&&(C||L||z)?l="inside":(l="outside",p.remove(),p=null)}else l="inside";if(!p&&(p=u(e,f,"outside"===l?_:b),d=Sr.bBox(p.node()),g=d.width,v=d.height,g<=0||v<=0))return void p.remove();"outside"===l?(y="both"===c.constraintext||"outside"===c.constraintext,m=function(t,e,r,n,i,a,o){var s,l="h"===a?Math.abs(n-r):Math.abs(e-t);l>2*Co&&(s=Co);var u=1;o&&(u="h"===a?Math.min(1,l/i.height):Math.min(1,l/i.width));var c,h,f,p,d=(i.left+i.right)/2,g=(i.top+i.bottom)/2;c=u*i.width,h=u*i.height,"h"===a?er?(f=(t+e)/2,p=n+s+h/2):(f=(t+e)/2,p=n-s-h/2);return zo(d,g,f,p,u,!1)}(i,a,o,s,d,h,y)):(y="both"===c.constraintext||"inside"===c.constraintext,m=function(t,e,r,n,i,a,o){var s,l,u,c,h,f,p,d=i.width,g=i.height,v=(i.left+i.right)/2,m=(i.top+i.bottom)/2,y=Math.abs(e-t),x=Math.abs(n-r);y>2*Co&&x>2*Co?(y-=2*(h=Co),x-=2*h):h=0;d<=y&&g<=x?(f=!1,p=1):d<=x&&g<=y?(f=!0,p=1):dr?(u=(t+e)/2,c=n-h-l/2):(u=(t+e)/2,c=n+h+l/2);return zo(v,m,u,c,p,f)}(i,a,o,s,d,h,y));p.attr("transform",m)}(t,A,i,u,p,d,g,v),n.layerClipId&&Sr.hideOutsideRangePoint(i[u],A.select("text"),a,o,c.xcalendar,c.ycalendar)}else e.select(this).remove();function k(t){return 0===s.bargap&&0===s.bargroupgap?e.round(Math.round(t)-w,2):t}})}),P.getComponentMethod("errorbars","plot")(l,n),l.each(function(t){var r=!1===t[0].trace.cliponaxis;Sr.setClipUrl(e.select(this),r?null:n.layerClipId)})};function zo(t,e,r,n,i,a){var o;return i<1?o="scale("+i+") ":(i=1,o=""),"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function Po(t,e,n,i){var a=Io((e=e||{}).family,n),o=Io(e.size,n),l=Io(e.color,n);return{family:Do(t.family,a,i.family),size:function(t,e,n){if(r(e)){e=+e;var i=t.min,a=t.max,o=void 0!==i&&ea;if(!o)return e}return void 0!==n?n:t.dflt}(t.size,o,i.size),color:function(t,e,r){return s(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,i.color)}}function Io(t,e){var r;return Array.isArray(t)?eu+s||!r(l))&&(h=!0,Xo(c,t))}for(var p=0;p1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&e.select(this).attr("shape-rendering","crispEdges")}),n.selectAll("g.points").each(function(r){var n=e.select(this),i=n.selectAll("path"),a=n.selectAll("text"),o=r[0].trace;Sr.pointStyle(i,o,t),Sr.selectedPointStyle(i,o),a.each(function(t){var r,n=e.select(this);function i(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}n.classed("bartext-inside")?r=o.insidetextfont:n.classed("bartext-outside")&&(r=o.outsidetextfont),r||(r=o.textfont),Sr.font(n,i("family"),i("size"),i("color"))}),Sr.selectedTextStyle(a,o)}),P.getComponentMethod("errorbars","style")(n)},ts=m.extendFlat,es=Qe.LINE_SPACING,rs={colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"},ns=function(t,r){var n={};function i(){var o=t._fullLayout,l=o._size;if("function"==typeof n.fillcolor||"function"==typeof n.line.color){var u,c,h=e.extent(("function"==typeof n.fillcolor?n.fillcolor:n.line.color).domain()),f=[],p=[],d="function"==typeof n.line.color?n.line.color:function(){return n.line.color},g="function"==typeof n.fillcolor?n.fillcolor:function(){return n.fillcolor},v=n.levels.end+n.levels.size/100,m=n.levels.size,y=1.001*h[0]-.001*h[1],x=1.001*h[1]-.001*h[0];for(c=0;c<1e5&&(u=n.levels.start+c*m,!(m>0?u>=v:u<=v));c++)u>y&&u0?u>=v:u<=v));c++)u>h[0]&&u1){var U=Math.pow(10,Math.floor(Math.log(V)/Math.LN10));N*=U*ne.roundUp(V/U,[2,5,10]),(Math.abs(n.levels.start)/n.levels.size+1e-6)%1<2e-6&&(F.tick0=0)}F.dtick=N}F.domain=[I+C,I+T-C],F.setScale();var q=o._infolayer.selectAll("g."+r).data([0]);q.enter().append("g").classed(r,!0).classed(rs.colorbar,!0).each(function(){var t=e.select(this);t.append("rect").classed(rs.cbbg,!0),t.append("g").classed(rs.cbfills,!0),t.append("g").classed(rs.cblines,!0),t.append("g").classed(rs.cbaxis,!0).classed(rs.crisp,!0),t.append("g").classed(rs.cbtitleunshift,!0).append("g").classed(rs.cbtitle,!0),t.append("rect").classed(rs.cboutline,!0),t.select(".cbtitle").datum(0)}),q.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var H=q.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")");F._axislayer=q.select(".cbaxis");var G=0;if(-1!==["top","bottom"].indexOf(n.titleside)){var W,Y=l.l+(n.x+S)*l.w,X=F.titlefont.size;W="top"===n.titleside?(1-(I+T-C))*l.h+l.t+3+.75*X:(1-(I+C))*l.h+l.t-3-.25*X,tt(F._id+"title",{attributes:{x:Y,y:W,"text-anchor":"start"}})}var Z,J,K,Q=ne.syncOrAsync([_n.previousPromises,function(){if(-1!==["top","bottom"].indexOf(n.titleside)){var r=q.select(".cbtitle"),i=r.select("text"),a=[-n.outlinewidth/2,n.outlinewidth/2],u=r.select(".h"+F._id+"title-math-group").node(),c=15.6;if(i.node()&&(c=parseInt(i.node().style.fontSize,10)*es),u?(G=Sr.bBox(u).height)>c&&(a[1]-=(G-c)/2):i.node()&&!i.classed(rs.jsPlaceholder)&&(G=Sr.bBox(i.node()).height),G){if(G+=5,"top"===n.titleside)F.domain[1]-=G/l.h,a[1]*=-1;else{F.domain[0]+=G/l.h;var v=er.lineCount(i);a[1]+=(1-v)*c}r.attr("transform","translate("+a+")"),F.setScale()}}q.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(l.h*(1-F.domain[1]))+")"),F._axislayer.attr("transform","translate(0,"+Math.round(-l.t)+")");var m=q.select(".cbfills").selectAll("rect.cbfill").data(p);m.enter().append("rect").classed(rs.cbfill,!0).style("stroke","none"),m.exit().remove(),m.each(function(t,r){var n=[0===r?h[0]:(p[r]+p[r-1])/2,r===p.length-1?h[1]:(p[r]+p[r+1])/2].map(F.c2p).map(Math.round);r!==p.length-1&&(n[1]+=n[1]>n[0]?1:-1);var i=g(t).replace("e-",""),a=s(i).toHexString();e.select(this).attr({x:L,width:Math.max(M,2),y:e.min(n),height:Math.max(e.max(n)-e.min(n),2),fill:a})});var y=q.select(".cblines").selectAll("path.cbline").data(n.line.color&&n.line.width?f:[]);return y.enter().append("path").classed(rs.cbline,!0),y.exit().remove(),y.each(function(t){e.select(this).attr("d","M"+L+","+(Math.round(F.c2p(t))+n.line.width/2%1)+"h"+M).call(Sr.lineGroupStyle,n.line.width,d(t),n.line.dash)}),F._axislayer.selectAll("g."+F._id+"tick,path").remove(),F._pos=L+M+(n.outlinewidth||0)/2-("outside"===n.ticks?1:0),F.side="right",ne.syncOrAsync([function(){return ri.doTicks(t,F,!0)},function(){if(-1===["top","bottom"].indexOf(n.titleside)){var r=F.titlefont.size,i=F._offset+F._length/2,a=l.l+(F.position||0)*l.w+("right"===F.side?10+r*(F.showticklabels?1:.5):-10-r*(F.showticklabels?.5:0));tt("h"+F._id+"title",{avoid:{selection:e.select(t).selectAll("g."+F._id+"tick"),side:n.titleside,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:i,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},_n.previousPromises,function(){var e=M+n.outlinewidth/2+Sr.bBox(F._axislayer.node()).width;if((b=H.select("text")).node()&&!b.classed(rs.jsPlaceholder)){var i,a=H.select(".h"+F._id+"title-math-group").node();i=a&&-1!==["top","bottom"].indexOf(n.titleside)?Sr.bBox(a).width:Sr.bBox(H.node()).right-L-l.l,e=Math.max(e,i)}var o=2*n.xpad+e+n.borderwidth+n.outlinewidth/2,s=D-O;q.select(".cbbg").attr({x:L-n.xpad-(n.borderwidth+n.outlinewidth)/2,y:O-E,width:Math.max(o,2),height:Math.max(s+2*E,2)}).call(Oe.fill,n.bgcolor).call(Oe.stroke,n.bordercolor).style({"stroke-width":n.borderwidth}),q.selectAll(".cboutline").attr({x:L,y:O+n.ypad+("top"===n.titleside?G:0),width:Math.max(M,2),height:Math.max(s-2*n.ypad-G,2)}).call(Oe.stroke,n.outlinecolor).style({fill:"None","stroke-width":n.outlinewidth});var u=({center:.5,right:1}[n.xanchor]||0)*o;q.attr("transform","translate("+(l.l-u)+","+l.t+")"),_n.autoMargin(t,r,{x:n.x,y:n.y,l:o*({right:1,center:.5}[n.xanchor]||0),r:o*({left:1,center:.5}[n.xanchor]||0),t:s*({bottom:1,middle:.5}[n.yanchor]||0),b:s*({top:1,middle:.5}[n.yanchor]||0)})}],t);if(Q&&Q.then&&(t._promises||[]).push(Q),t._context.edits.colorbarPosition)Ua.init({element:q.node(),gd:t,prepFn:function(){Z=q.attr("transform"),Ka(q)},moveFn:function(t,e){q.attr("transform",Z+" translate("+t+","+e+")"),J=Ua.align(z+t/l.w,A,0,1,n.xanchor),K=Ua.align(I-e/l.h,T,0,1,n.yanchor);var r=Ua.getCursor(J,K,n.xanchor,n.yanchor);Ka(q,r)},doneFn:function(){Ka(q),void 0!==J&&void 0!==K&&P.call("restyle",t,{"colorbar.x":J,"colorbar.y":K},a().index)}});return Q}function $(t,e){return ne.coerce(R,F,Ce,t,e)}function tt(e,r){var n,i=a();n=P.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var s={propContainer:F,propName:n,traceIndex:i.index,placeholder:o._dfltTitle.colorbar,containerGroup:q.select(".cbtitle")},l="h"===e.charAt(0)?e.substr(1):"h"+e;q.selectAll("."+l+",."+l+"-math-group").remove(),Dn.draw(t,e,ts(s,r||{}))}o._infolayer.selectAll("g."+r).remove()}function a(){var e,n,i=r.substr(2);for(e=0;e=0&&M0){var k=_[n].sort(ds),T=k.map(gs),S=T.length,E={pos:v[n],pts:k};E.min=T[0],E.max=T[S-1],E.mean=ne.mean(T,S),E.sd=ne.stdev(T,S,E.mean),E.q1=ne.interp(T,.25),E.med=ne.interp(T,.5),E.q3=ne.interp(T,.75),E.lf=Math.min(E.q1,T[Math.min(ne.findBin(2.5*E.q1-1.5*E.q3,T,!0)+1,S-1)]),E.uf=Math.max(E.q3,T[Math.max(ne.findBin(2.5*E.q3-1.5*E.q1,T),0)]),E.lo=4*E.q1-3*E.q3,E.uo=4*E.q3-3*E.q1;var C=1.57*(E.q3-E.q1)/Math.sqrt(S);E.ln=E.med-C,E.un=E.med+C,h.push(E)}return function(t,e){if(ne.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(h[0].t={num:l[f],dPos:m,posLetter:s,valLetter:a,labels:{med:hs(t,"median:"),min:hs(t,"min:"),q1:hs(t,"q1:"),q3:hs(t,"q3:"),max:hs(t,"max:"),mean:"sd"===e.boxmean?hs(t,"mean \xb1 \u03c3:"):hs(t,"mean:"),lf:hs(t,"lower fence:"),uf:hs(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete h[0].t.labels,l[f]++,h):[{t:{empty:!0}}]};function ps(t,e,r){var n={text:"tx"};for(var i in n)Array.isArray(e[i])&&(t[n[i]]=e[i][r])}function ds(t,e){return t.v-e.v}function gs(t){return t.v}function vs(t,e,r,n){var i,a=r("y"),o=r("x");if(a&&a.length)i="v",o||r("x0");else{if(!o||!o.length)return void(e.visible=!1);i="h",r("y0")}P.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function ms(t,e,r,n){var i=n.prefix,a=ne.coerce2(t,e,cs,"marker.outliercolor"),o=r("marker.line.outliercolor"),s=r(i+"points",a||o?"suspectedoutliers":void 0);s?(r("jitter","all"===s?.3:0),r("pointpos","all"===s?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===s&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),ne.coerceSelectionMarkerOpacity(e,r)}var ys={supplyDefaults:function(t,e,r,n){function i(r,n){return ne.coerce(t,e,cs,r,n)}vs(t,e,i,n),!1!==e.visible&&(i("line.color",(t.marker||{}).color||r),i("line.width"),i("fillcolor",Oe.addOpacity(e.line.color,.5)),i("whiskerwidth"),i("boxmean"),i("notched",void 0!==t.notchwidth)&&i("notchwidth"),ms(t,e,i,{prefix:"box"}))},handleSampleDefaults:vs,handlePointsDefaults:ms};function xs(t,e,r,n){var i,a,o,s,l,u,c,h,f,p,d,g,v=t.cd,m=t.xa,y=t.ya,x=v[0].trace,b=v[0].t,_="violin"===x.type,w=[],M=b.bdPos,A=function(t){return t.pos+b.bPos-u};_&&"both"!==x.side?("positive"===x.side&&(f=function(t){var e=A(t);return yo.inbox(e,e+M,p)}),"negative"===x.side&&(f=function(t){var e=A(t);return yo.inbox(e-M,e,p)})):f=function(t){var e=A(t);return yo.inbox(e-M,e+M,p)},g=_?function(t){return yo.inbox(t.span[0]-l,t.span[1]-l,p)}:function(t){return yo.inbox(t.min-l,t.max-l,p)},"h"===x.orientation?(l=e,u=r,c=g,h=f,i="y",o=y,a="x",s=m):(l=r,u=e,c=f,h=g,i="x",o=m,a="y",s=y);var k=Math.min(1,M/Math.abs(o.r2c(o.range[1])-o.r2c(o.range[0])));function T(t){return(c(t)+h(t))/2}p=t.maxHoverDistance-k,d=t.maxSpikeDistance-k;var S=yo.getDistanceFunction(n,c,h,T);if(yo.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],C=x.line.color,L=(x.marker||{}).color;Oe.opacity(C)&&x.line.width?t.color=C:Oe.opacity(L)&&x.boxpoints?t.color=L:t.color=x.fillcolor,t[i+"0"]=o.c2p(E.pos+b.bPos-b.bdPos,!0),t[i+"1"]=o.c2p(E.pos+b.bPos+b.bdPos,!0),ri.tickText(o,o.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var z=i+"Spike";t.spikeDistance=T(E)*d/p,t[z]=o.c2p(E.pos,!0);var P={},I=["med","min","q1","q3","max"];(x.boxmean||(x.meanline||{}).visible)&&I.push("mean"),(x.boxpoints||x.points)&&I.push("lf","uf");for(var D=0;Dt.uf}),a=Math.max((t.max-t.min)/10,t.q3-t.q1),u=1e-9*a,c=a*Ts,h=[],f=0;if(r.jitter){if(0===a)for(f=1,h=new Array(i.length),e=0;et.lo&&(y.so=!0)}return i}).enter().append("path").classed("point",!0).call(Sr.translatePoints,i,a)}function Cs(t,r,n,i){var a,o,s=r.pos,l=r.val,u=i.bPos,c=i.bPosPxOffset||0;Array.isArray(i.bdPos)?(a=i.bdPos[0],o=i.bdPos[1]):(a=i.bdPos,o=i.bdPos),t.selectAll("path.mean").data(ne.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var r=s.c2p(t.pos+u,!0)+c,i=s.c2p(t.pos+u-a,!0)+c,h=s.c2p(t.pos+u+o,!0)+c,f=l.c2p(t.mean,!0),p=l.c2p(t.mean-t.sd,!0),d=l.c2p(t.mean+t.sd,!0);"h"===n.orientation?e.select(this).attr("d","M"+f+","+i+"V"+h+("sd"===n.boxmean?"m0,0L"+p+","+r+"L"+f+","+i+"L"+d+","+r+"Z":"")):e.select(this).attr("d","M"+i+","+f+"H"+h+("sd"===n.boxmean?"m0,0L"+r+","+p+"L"+i+","+f+"L"+r+","+d+"Z":""))})}var Ls={plot:function(t,r,n){var i=t._fullLayout,a=r.xaxis,o=r.yaxis;r.plot.select(".boxlayer").selectAll("g.trace.boxes").data(n).enter().append("g").attr("class","trace boxes").each(function(t){var r,n,s=t[0],l=s.t,u=s.trace,c=s.node3=e.select(this),h=i._numBoxes,f="group"===i.boxmode&&h>1,p=l.dPos*(1-i.boxgap)*(1-i.boxgroupgap)/(f?h:1),d=f?2*l.dPos*((l.num+.5)/h-.5)*(1-i.boxgap):0,g=p*u.whiskerwidth;!0!==u.visible||l.empty?e.select(this).remove():("h"===u.orientation?(r=o,n=a):(r=a,n=o),l.bPos=d,l.bdPos=p,l.wdPos=g,Ss(c,{pos:r,val:n},u,l),u.boxpoints&&Es(c,{x:a,y:o},u,l),u.boxmean&&Cs(c,{pos:r,val:n},u,l))})},plotBoxAndWhiskers:Ss,plotPoints:Es,plotBoxMean:Cs},zs=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),Us(Gs.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(Zs.local.differentCalendars||Zs.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+Ws(Math.abs(this.year()),4)+"-"+Ws(this.month(),2)+"-"+Ws(this.day(),2)}}),Us(Ys.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new Gs(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+Ws(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,Zs.local.invalidMonth||Zs.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,Zs.local.invalidMonth||Zs.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,Zs.local.invalidYear||Zs.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,Zs.local.invalidDate||Zs.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var Zs=qs=new Hs;Zs.cdate=Gs,Zs.baseCalendar=Ys,Zs.calendars.gregorian=Xs;var Js=qs.instance();function Ks(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}Ks.prototype=new qs.baseCalendar,Us(Ks.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match($s);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(tl);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(el);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw qs.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw qs.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,qs.local.invalidyear),a=nl[i-nl[0]],o=a>>9&4095,s=a>>5&15,l=31&a;(n=Js.newDate(o,s,l)).add(4-(n.dayOfWeek()||7),"d");var u=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(u/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=rl[t-rl[0]];if(e>(r>>13?12:11))throw qs.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,a,r,qs.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),a=this.toChineseMonth(t,e),o=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l="number"==typeof t&&t>=1888&&t<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var u="number"==typeof e&&e>=1&&e<=12;if(!u)throw new Error("Lunar month outside range 1 - 12");var c,h="number"==typeof r&&r>=1&&r<=30;if(!h)throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(c=!1,a=n):(c=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:c}}s=o.day-1;var f,p=rl[o.year-rl[0]],d=p>>13;f=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var g=0;g>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=y.getFullYear(),a.month=1+y.getMonth(),a.day=y.getDate(),a}(t,a,r,i);return Js.toJD(o.year,o.month,o.day)},fromJD:function(t){var e=Js.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{var o="number"==typeof t&&t>=1888&&t<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s="number"==typeof e&&e>=1&&e<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l="number"==typeof r&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var u=nl[i.year-nl[0]],c=i.year<<9|i.month<<5|i.day;a.year=c>=u?i.year:i.year-1,u=nl[a.year-nl[0]];var h,f=new Date(u>>9&4095,(u>>5&15)-1,31&u),p=new Date(i.year,i.month-1,i.day);h=Math.round((p-f)/864e5);var d,g=rl[a.year-rl[0]];for(d=0;d<13;d++){var v=g&1<<12-d?30:29;if(h>13;!m||d=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return{century:ol[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var ol={20:"Fruitbat",21:"Anchovy"};qs.calendars.discworld=al;function sl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}sl.prototype=new qs.baseCalendar,Us(sl.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear||qs.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),qs.calendars.ethiopian=sl;function ll(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function ul(t,e){return t-e*Math.floor(t/e)}ll.prototype=new qs.baseCalendar,Us(ll.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return ul(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,qs.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===ul(this.daysInYear(t),10)?30:9===e&&3===ul(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,a=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var o=7;o<=this.monthsInYear(t);o++)a+=this.daysInMonth(t,o);for(o=1;o=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),qs.calendars.hebrew=ll;function cl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}cl.prototype=new qs.baseCalendar,Us(cl.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),qs.calendars.islamic=cl;function hl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}hl.prototype=new qs.baseCalendar,Us(hl.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),qs.calendars.julian=hl;function fl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function pl(t,e){return t-e*Math.floor(t/e)}function dl(t,e){return pl(t-1,e)+1}fl.prototype=new qs.baseCalendar,Us(fl.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,qs.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,qs.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,qs.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,qs.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=pl((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,pl(e,20)]},_toTzolkin:function(t){return[dl((t-=this.jdEpoch)+20,20),dl(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),qs.calendars.mayan=fl;function vl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}vl.prototype=new qs.baseCalendar;var ml=qs.instance("gregorian");Us(vl.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear||qs.regionalOptions[""].invalidYear);return ml.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidMonth);(t=n.year())<0&&t++;for(var i=n.day(),a=1;a=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),qs.calendars.nanakshahi=vl;function yl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}yl.prototype=new qs.baseCalendar,Us(yl.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,qs.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=qs.instance(),a=0,o=e,s=t;this._createMissingCalendarData(t);var l=t-(o>9||9===o&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==e&&(a=r,o--);9!==o;)o<=0&&(o=12,s--),a+=this.NEPALI_CALENDAR_DATA[s][o],o--;return 9===e?(a+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(a+=i.daysInYear(l)):a+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(l,1,1).add(a,"d").toJD()},fromJD:function(t){var e=qs.instance().fromJD(t),r=e.year(),n=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var a=9,o=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][a]-o+1;n>s;)++a>12&&(a=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][a];var l=this.NEPALI_CALENDAR_DATA[i][a]-(s-n);return this.newDate(i,a,l)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t-(t>=0?474:473),a=474+bl(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*a-110)/2816)+365*(a-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=bl(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),o=bl(n,366);i=Math.floor((2134*a+2816*o+2815)/1028522)+a+1}var s=i+2820*r+474;s=s<=0?s-1:s;var l=t-this.toJD(s,1,1)+1,u=l<=186?Math.ceil(l/31):Math.ceil((l-6)/30),c=t-this.toJD(s,u,1)+1;return this.newDate(s,u,c)}}),qs.calendars.persian=xl,qs.calendars.jalali=xl;var _l=qs.instance();function wl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}wl.prototype=new qs.baseCalendar,Us(wl.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);t=this._t2gYear(e.year());return _l.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);t=this._t2gYear(n.year());return _l.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);t=this._t2gYear(n.year());return _l.toJD(t,n.month(),n.day())},fromJD:function(t){var e=_l.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),qs.calendars.taiwan=wl;var Ml=qs.instance();function Al(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}Al.prototype=new qs.baseCalendar,Us(Al.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);t=this._t2gYear(e.year());return Ml.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);t=this._t2gYear(n.year());return Ml.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,qs.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate);t=this._t2gYear(n.year());return Ml.toJD(t,n.month(),n.day())},fromJD:function(t){var e=Ml.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),qs.calendars.thai=Al;function kl(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}kl.prototype=new qs.baseCalendar,Us(kl.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,qs.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,qs.local.invalidMonth).toJD()-24e5+.5,n=0,i=0;ir)return Tl[n]-Tl[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,qs.local.invalidDate),i=12*(n.year()-1)+n.month()-15292;return n.day()+Tl[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),o=a+1,s=i-12*a,l=e-Tl[r-1]+1;return this.newDate(o,s,l)},isValid:function(t,e,r){var n=qs.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var i=qs.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw n.replace(/\{0\}/,this.local.name);return i}}),qs.calendars.ummalqura=kl;var Tl=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990];Us(qs.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),qs.local=qs.regionalOptions[""],Us(qs.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),Us(qs.baseCalendar.prototype,{UNIX_EPOCH:qs.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:qs.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw qs.local.invalidFormat||qs.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,a,o,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,l=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,c=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;_+n1}),p=function(t,e,r,n){var i=""+e;if(f(t,n))for(;i.length1},y=function(t,r){var n=m(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],a=new RegExp("^-?\\d{1,"+i+"}"),o=e.substring(A).match(a);if(!o)throw(qs.local.missingNumberAt||qs.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=o[0].length,parseInt(o[0],10)},x=this,b=function(){if("function"==typeof s){m("m");var t=s.call(x,e.substring(A));return A+=t.length,t}return y("m")},_=function(t,r,n,i){for(var a=m(t,i)?n:r,o=0;o-1){f=1,p=d;for(var S=this.daysInMonth(h,f);p>S;S=this.daysInMonth(h,f))f++,p-=S}return c>-1?this.fromJD(c):this.newDate(h,f,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}});var Sl=qs,El=t.EPOCHJD,Cl=t.ONEDAY,Ll={valType:"enumerated",values:Object.keys(Sl.calendars),editType:"calc",dflt:"gregorian"},zl=function(t,e,r,n){var i={};return i[r]=Ll,ne.coerce(t,e,i,r,n)},Pl="##",Il={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:Pl,w:Pl,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}};var Dl={};function Ol(t){var e=Dl[t];return e||(e=Dl[t]=Sl.instance(t))}function Rl(t){return ne.extendFlat({},Ll,{description:t})}function Fl(t){return"Sets the calendar system to use with `"+t+"` date data."}var Bl={xcalendar:Rl(Fl("x"))},Nl=ne.extendFlat({},Bl,{ycalendar:Rl(Fl("y"))}),jl=ne.extendFlat({},Nl,{zcalendar:Rl(Fl("z"))}),Vl=Rl(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" ")),Ul={moduleType:"component",name:"calendars",schema:{traces:{scatter:Nl,bar:Nl,box:Nl,heatmap:Nl,contour:Nl,histogram:Nl,histogram2d:Nl,histogram2dcontour:Nl,scatter3d:jl,surface:jl,mesh3d:jl,scattergl:Nl,ohlc:Bl,candlestick:Bl},layout:{calendar:Rl(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:Vl},yaxis:{calendar:Vl},scene:{xaxis:{calendar:Vl},yaxis:{calendar:Vl},zaxis:{calendar:Vl}},polar:{radialaxis:{calendar:Vl}}},transforms:{filter:{valuecalendar:Rl(["Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:Rl(["Sets the calendar system to use for `target`, if it is an","array of dates. If `target` is a string (eg *x*) we use the","corresponding trace attribute (eg `xcalendar`) if it exists,","even if `targetcalendar` is provided."].join(" "))}}},layoutAttributes:Ll,handleDefaults:zl,handleTraceDefaults:function(t,e,r,n){for(var i=0;in?e=!0:r=10)return null;var n=1/0;var i=-1/0;var a=e.length;for(var o=0;o0&&(p=t.dxydi([],i-1,o,0,s),m.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),m.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),m.push(f[0]),y.push(f[1]),l=f;else for(i=t.a2i(e),u=Math.floor(Math.max(0,Math.min(C-2,i))),c=i-u,b.length=C,b.crossLength=L,b.xy=function(e){return t.evalxy([],i,e)},b.dxy=function(e,r){return t.dxydj([],u,e,c,r)},a=0;a0&&(g=t.dxydj([],u,a-1,c,0),m.push(l[0]+g[0]/3),y.push(l[1]+g[1]/3),v=t.dxydj([],u,a-1,c,1),m.push(f[0]-v[0]/3),y.push(f[1]-v[1]/3)),m.push(f[0]),y.push(f[1]),l=f;return b.axisLetter=r,b.axis=x,b.crossAxis=A,b.value=e,b.constvar=n,b.index=h,b.x=m,b.y=y,b.smoothing=A.smoothing,b}function I(e){var i,a,o,s,l,u=[],c=[],h={};if(h.length=y.length,h.crossLength=M.length,"b"===r)for(o=Math.max(0,Math.min(L-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;iy.length-1||b.push(hu(I(a),{color:x.gridcolor,width:x.gridwidth}));for(h=u;hy.length-1||d<0||d>y.length-1))for(g=y[o],v=y[d],i=0;iy[y.length-1]||_.push(hu(P(p),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&w.push(hu(I(0),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&w.push(hu(I(y.length-1),{color:x.endlinecolor,width:x.endlinewidth}))}else{for(s=5e-15,u=(l=[Math.floor((y[y.length-1]-x.tick0)/x.dtick*(1+s)),Math.ceil((y[0]-x.tick0)/x.dtick/(1+s))].sort(function(t,e){return t-e}))[0],c=l[1],h=u;h<=c;h++)f=x.tick0+x.dtick*h,b.push(hu(P(f),{color:x.gridcolor,width:x.gridwidth}));for(h=u-1;hy[y.length-1]||_.push(hu(P(p),{color:x.minorgridcolor,width:x.minorgridwidth}));x.startline&&w.push(hu(P(y[0]),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&w.push(hu(P(y[y.length-1]),{color:x.endlinecolor,width:x.endlinewidth}))}},pu=m.extendFlat,du=function(t,e){var r,n,i,a=e._labels=[],o=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&i0&&n1e-5);return ne.log("Smoother converged to",M,"after",A,"iterations"),t},xu=function(t,e){var n,i,a,o,s,l;function u(t){if(r(t))return+t}if(e){for(n=0,s=0;ss&&tu&&el||ec},a.c2p=function(t){return t},o.c2p=function(t){return t},t.setScale=function(){var e,r,s,l=t._x,u=t._y,c=function(t,e,r,n,i,a){var o,s,l,u,c,h,f,p,d,g,v=r[0].length,m=r.length,y=i?3*v-2:v,x=a?3*m-2:m;for(t=Au(t,x),e=Au(e,x),l=0;le[n-1]|or[i-1]))return[!1,!1];var l=t.a2i(a),u=t.b2j(o),c=t.evalxy([],l,u);if(s){var h,f,p,d,g=0,v=0,m=[];ae[n-1]?(h=n-2,f=1,g=(a-e[n-1])/(e[n-1]-e[n-2])):f=l-(h=Math.max(0,Math.min(n-2,Math.floor(l)))),or[i-1]?(p=i-2,d=1,v=(o-r[i-1])/(r[i-1]-r[i-2])):d=u-(p=Math.max(0,Math.min(i-2,Math.floor(u)))),g&&(t.dxydi(m,h,p,f,d),c[0]+=m[0]*g,c[1]+=m[1]*g),v&&(t.dxydj(m,h,p,f,d),c[0]+=m[0]*v,c[1]+=m[1]*v)}return c},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=h*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=f*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}},Cu=ne.isArrayOrTypedArray,Lu=function(t){return Cu(t[0])},zu=t.BADNUM,Pu=function(t,e,r,n,i,a){n=n||"x",i=i||"y",a=a||["z"];var o,s,l,u=t[n].slice(),c=t[i].slice(),h=t.text,f=Math.min(u.length,c.length),p=void 0!==h&&!Array.isArray(h[0]),d=t[n+"calendar"],g=t[i+"calendar"];for(o=0;oe.length&&(t=t.slice(0,e.length)):t=[],n=0;n90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}};function Fu(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function Bu(t,e,r){var n=r[0],i=r[0].trace,a=e.xaxis,o=e.yaxis,s=i.aaxis,l=i.baxis,u=t._fullLayout,c=e.plot.selectAll(".carpetlayer"),h=u._clips,f=Fu(c,"g","carpet"+i.uid).classed("trace",!0),p=Fu(f,"g","minorlayer"),d=Fu(f,"g","majorlayer"),g=Fu(f,"g","boundarylayer"),v=Fu(f,"g","labellayer");f.style("opacity",i.opacity),Nu(a,o,d,s,"a",s._gridlines),Nu(a,o,d,l,"b",l._gridlines),Nu(a,o,p,s,"a",s._minorgridlines),Nu(a,o,p,l,"b",l._minorgridlines),Nu(a,o,g,s,"a-boundary",s._boundarylines),Nu(a,o,g,l,"b-boundary",l._boundarylines),function(t,e,r,n,i,a,o,s){var l,u,c,h;l=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],c=r.ab2xy(l,u,!0),h=r.dxyda_rough(l,u),void 0===o.angle&&ne.extendFlat(o,Ru(r,i,a,c,r.dxydb_rough(l,u)));qu(t,e,r,n,c,h,r.aaxis,i,a,o,"a-title"),l=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),c=r.ab2xy(l,u,!0),h=r.dxydb_rough(l,u),void 0===s.angle&&ne.extendFlat(s,Ru(r,i,a,c,r.dxyda_rough(l,u)));qu(t,e,r,n,c,h,r.baxis,i,a,s,"b-title")}(t,v,i,n,a,o,ju(t,a,o,i,n,v,s._labels,"a-label"),ju(t,a,o,i,n,v,l._labels,"b-label")),function(t,e,r,n,i){var a,o,s,l,u=r.select("#"+t._clipPathId);u.size()||(u=r.append("clipPath").classed("carpetclip",!0));var c=Fu(u,"path","carpetboundary"),h=e.clipsegments,f=[];for(l=0;l0?"start":"end","data-notex":1}).call(Sr.font,a.font).text(a.text).call(er.convertToTspans,t),p=Sr.bBox(this);f.attr("transform","translate("+s.p[0]+","+s.p[1]+") rotate("+s.angle+")translate("+a.axis.labelpadding*u+","+.3*p.height+")"),c=Math.max(c,p.width+a.axis.labelpadding)}),u.exit().remove(),h.maxExtent=c,h}var Vu=Qe.LINE_SPACING,Uu=(1-Qe.MID_SHIFT)/Vu+1;function qu(t,r,n,i,a,o,s,l,u,c,h){var f=[];s.title&&f.push(s.title);var p=r.selectAll("text."+h).data(f),d=c.maxExtent;p.enter().append("text").classed(h,!0),p.each(function(){var r=Ru(n,l,u,a,o);-1===["start","both"].indexOf(s.showticklabels)&&(d=0);var i=s.titlefont.size;d+=i+s.titleoffset;var h=(c.angle+(c.flip<0?180:0)-r.angle+450)%360,f=h>90&&h<270,p=e.select(this);p.text(s.title||"").call(er.convertToTspans,t),f&&(d=(-er.lineCount(p)+Uu)*Vu*i-d),p.attr("transform","translate("+r.p[0]+","+r.p[1]+") rotate("+r.angle+") translate(0,"+d+")").classed("user-select-none",!0).attr("text-anchor","middle").call(Sr.font,s.titlefont)}),p.exit().remove()}var Hu={};Hu.attributes=lu,Hu.supplyDefaults=function(t,e,r,n){function i(r,n){return ne.coerce(t,e,lu,r,n)}e._clipPathId="clip"+e.uid+"carpet";var a=i("color",C.defaultLine);if(ne.coerceFont(i,"font"),i("carpet"),wu(t,e,n,i,a),e.a&&e.b){e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0);var o=function(t,e,r){var n=[],i=r("x");i&&!Lu(i)&&n.push("x"),e._cheater=!i;var a=r("y");if(a&&!Lu(a)&&n.push("y"),i||a)return n.length&&Pu(e,e.aaxis,e.baxis,"a","b",n),!0}(0,e,i);Eu(e),e._cheater&&i("cheaterslope"),o||(e.visible=!1)}else e.visible=!1},Hu.plot=function(t,e,r){for(var n=0;n=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}(e.xctrl,e.yctrl,a,o),u.x=r,u.y=c,u.a=s,u.b=l,[u]},Hu.animatable=!0,Hu.moduleType="trace",Hu.name="carpet",Hu.basePlotModule=ua,Hu.categories=["cartesian","carpet","carpetAxis","notLegendIsolatable"],Hu.meta={};var Gu=Hu,Wu={exports:{}};!function(t,e){"object"==typeof Wu.exports?e(Wu.exports):e(t.topojson=t.topojson||{})}(this,function(t){"use strict";var e=function(t){return t},r=function(t){if(null==(r=t.transform))return e;var r,n,i,a=r.scale[0],o=r.scale[1],s=r.translate[0],l=r.translate[1];return function(t,e){return e||(n=i=0),t[0]=(n+=t[0])*a+s,t[1]=(i+=t[1])*o+l,t}},n=function(t){var e=t.bbox;function n(t){l[0]=t[0],l[1]=t[1],s(l),l[0]h&&(h=l[0]),l[1]f&&(f=l[1])}function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Point":n(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(n)}}if(!e){var a,o,s=r(t),l=new Array(2),u=1/0,c=u,h=-u,f=-u;for(o in t.arcs.forEach(function(t){for(var e=-1,r=t.length;++eh&&(h=l[0]),l[1]