All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.plotly-gl3d.min.js Maven / Gradle / Ivy

The newest version!
/**
* plotly.js (gl3d - minified) v2.34.0
* Copyright 2012-2024, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
/*! For license information please see plotly-gl3d.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Plotly=e():t.Plotly=e()}(self,(function(){return function(){var t={9288:function(t,e,r){"use strict";var n=r(3400),i={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},6712:function(t,e,r){"use strict";t.exports=r(1843)},6144:function(t,e,r){"use strict";t.exports=r(5396)},4680:function(t,e,r){"use strict";t.exports=r(6048)},2016:function(t,e,r){"use strict";t.exports=r(4884)},5556:function(t,e,r){"use strict";t.exports=r(6744)},6489:function(t,e,r){"use strict";t.exports=r(2028)},7988:function(t,e,r){"use strict";var n=r(2016);n.register([r(8824),r(9904),r(5120),r(3752),r(4340),r(4680),r(9800),r(6712),r(5556),r(6489),r(7312),r(6144)]),t.exports=n},5120:function(t,e,r){"use strict";t.exports=r(6296)},4340:function(t,e,r){"use strict";t.exports=r(2640)},8824:function(t,e,r){"use strict";t.exports=r(3296)},7312:function(t,e,r){"use strict";t.exports=r(6272)},9800:function(t,e,r){"use strict";t.exports=r(5436)},9904:function(t,e,r){"use strict";t.exports=r(1304)},3752:function(t,e,r){"use strict";t.exports=r(7776)},2196:function(t){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},3916:function(t,e,r){"use strict";var n=r(2196),i=r(5376),a=r(3816),o=r(1780).templatedArray;r(6208),t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},272:function(t,e,r){"use strict";var n=r(3400),i=r(4460),a=r(6196).draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,v=d-h,g=3*t.startarrowsize*t.arrowwidth||0,m=g+h,y=g-h;if(u===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:v}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,v,y)});t._extremes[n]=r}t.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},2300:function(t,e,r){"use strict";var n=r(3400),i=r(4040),a=r(1780).arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(u.length||c.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var q=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=it.r2fraction(e["a"+et]))<0||dt>1)&&(q=!0):q=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(Q=e[et],J=pt?it._offset+it._length*Q:J=M.l+M.w*Q):(Q=1-e[et],J=pt?it._offset+it._length*Q:J=M.t+M.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var vt=e["a"+et];if(tt=ot*Y(.5,e.xanchor)-st*Y(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(vt=1-vt),ft.tail=it._offset+it._length*vt):"paper"===gt?"y"===et?(vt=1-vt,ft.tail=M.t+M.h*vt):ft.tail=M.l+M.w*vt:ft.tail=it._offset+it.r2p(vt),K=tt}else ft.tail=J+vt,K=tt+vt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ct,ft.head+=ct}else K=tt=lt*Y($,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(q)z.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(A-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(I-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+bt-1,y:B+_t}).call(c.setClipUrl,U?E:null,t);else{var wt=B+_t-v.top,Mt=B+bt-v.left;G.call(h.positionText,Mt,wt).call(c.setClipUrl,U?E:null,t)}H.select("rect").call(c.setRect,B,B,A,I),j.call(c.setRect,F/2,F/2,N-F,V-F),z.call(c.setTranslate,Math.round(O.x.text-N/2),Math.round(O.y.text-V/2)),D.attr({transform:"rotate("+C+","+O.x.text+","+O.y.text+")"});var Tt,At=function(r,n){R.selectAll(".annotation-arrow-g").remove();var l=O.x.head,f=O.y.head,h=O.x.tail+r,d=O.y.tail+n,v=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(C,v,b),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),E=+j.attr("width"),P=+j.attr("height"),I=v-.5*E,F=I+E,N=b-.5*P,B=N+P,U=[[I,N,I,B],[I,B,F,B],[F,B,F,N],[F,N,I,N]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,V=e.arrowcolor,Y=e.arrowside,G=R.append("g").style({opacity:u.opacity(V)}).classed("annotation-arrow-g",!0),W=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(u.stroke,u.rgb(V));if(g(W,Y,e),T.annotationPosition&&W.node().parentNode&&!a){var q=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));q+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-q)+","+(d-X),transform:s(q,X)}).style("stroke-width",H+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(z);J=t.x,K=t.y,m&&m.autorange&&k(m._name+".autorange",!0),x&&x.autorange&&k(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;z.call(c.setTranslate,i,a),L("x",y(m,t,"x",M,e)),L("y",y(x,r,"y",M,e)),e.axref===e.xref&&L("ax",y(m,t,"ax",M,e)),e.ayref===e.yref&&L("ay",y(x,r,"ay",M,e)),G.attr("transform",s(t,r)),D.attr({transform:"rotate("+C+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&At(0,0),P&&p.init({element:z.node(),gd:t,prepFn:function(){Tt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?L("ax",y(m,t,"ax",M,e)):L("ax",e.ax+t),e.ayref===e.yref?L("ay",y(x,r,"ay",M.w,e)):L("ay",e.ay+r),At(t,r);else{if(a)return;var i,o;if(m)i=y(m,t,"x",M,e);else{var l=e._xsize/M.w,u=e.x+(e._xshift-e.xshift)/M.w-l/2;i=p.align(u+t/M.w,l,0,1,e.xanchor)}if(x)o=y(x,r,"y",M,e);else{var c=e._ysize/M.h,f=e.y-(e._yshift+e.yshift)/M.h-c/2;o=p.align(f-r/M.h,c,0,1,e.yanchor)}L("x",i),L("y",o),m&&x||(n=p.getCursor(m?.5:i,x?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+Tt}),d(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",W(n))},doneFn:function(){d(z),i.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}t.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=e.indexOf("end")>=0,b=p.backoff*g+r.standoff,_=v.backoff*m+r.startstandoff;if("line"===d.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,M=o.y-c.y;if(h=(f=Math.atan2(M,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+M*M))return void P();if(b){if(b*b>w*w+M*M)return void P();var T=b*Math.cos(f),A=b*Math.sin(f);c.x+=T,c.y+=A,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+M*M)return void P();var k=_*Math.cos(f),L=_*Math.sin(f);o.x-=k,o.y-=L,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var S=d.getTotalLength(),E="";if(S1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},6864:function(t,e,r){"use strict";var n=r(4040),i=r(3400);t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:r(5899)}}},layoutAttributes:r(5899),handleDefaults:r(2808),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||u).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.interpolate=function(t,e,r){var i=n(t).toRgb(),a=n(e).toRgb(),o={r:r*i.r+(1-r)*a.r,g:r*i.g+(1-r)*a.g,b:r*i.b+(1-r)*a.b};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,u))),(i.isDark()?e?i.lighten(e):u:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>c&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var dt=Math.pow(10,Math.floor(Math.log(ht)/Math.LN10));ct*=dt*u.roundUp(ht/dt,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ct}lt.domain=o?[ot+R/N.h,ot+$-R/N.h]:[ot+C/N.w,ot+$-C/N.w],lt.setScale(),t.attr("transform",c(Math.round(N.l),Math.round(N.t)));var pt,vt=t.select("."+A.cbtitleunshift).attr("transform",c(-Math.round(N.l),-Math.round(N.t))),gt=lt.ticklabelposition,mt=lt.title.font.size,yt=t.select("."+A.cbaxis),xt=0,bt=0;function _t(n,i){var a={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),v.draw(r,n,f(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){var t,e;(o&&ut||!o&&!ut)&&("top"===H&&(t=C+N.l+tt*D,e=R+N.t+et*(1-ot-$)+3+.75*mt),"bottom"===H&&(t=C+N.l+tt*D,e=R+N.t+et*(1-ot)-3-.25*mt),"right"===H&&(e=R+N.t+et*P+3+.75*mt,t=C+N.l+tt*ot),_t(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ut||o&&ut){var a,l=t.select("."+A.cbtitle),f=l.select("text"),h=[-k/2,k/2],p=l.select(".h"+lt._id+"title-math-group").node(),v=15.6;if(f.node()&&(v=parseInt(f.node().style.fontSize,10)*w),p?(a=d.bBox(p),bt=a.width,(xt=a.height)>v&&(h[1]-=(xt-v)/2)):f.node()&&!f.classed(A.jsPlaceholder)&&(a=d.bBox(f.node()),bt=a.width,xt=a.height),o){if(xt){if(xt+=5,"top"===H)lt.domain[1]-=xt/N.h,h[1]*=-1;else{lt.domain[0]+=xt/N.h;var m=g.lineCount(f);h[1]+=(1-m)*v}l.attr("transform",c(h[0],h[1])),lt.setScale()}}else bt&&("right"===H&&(lt.domain[0]+=(bt+mt/2)/N.w),l.attr("transform",c(h[0],h[1])),lt.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",o?c(0,Math.round(N.h*(1-lt.domain[1]))):c(Math.round(N.w*lt.domain[0]),0)),yt.attr("transform",o?c(0,Math.round(-N.t)):c(Math.round(-N.l),0));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(X);y.enter().append("rect").classed(A.cbfill,!0).attr("style",""),y.exit().remove();var x=V.map(lt.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var s=[0===a?V[0]:(X[a]+X[a-1])/2,a===X.length-1?V[1]:(X[a]+X[a+1])/2].map(lt.c2p).map(Math.round);o&&(s[1]=u.constrain(s[1]+(s[1]>s[0])?1:-1,x[0],x[1]));var l=n.select(this).attr(o?"x":"y",rt).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(J,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)d.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var c=G(t).replace("e-","");l.attr("fill",i(c).toHexString())}}));var b=t.select("."+A.cblines).selectAll("path."+A.cbline).data(j.color&&j.width?Z:[]);b.enter().append("path").classed(A.cbline,!0),b.exit().remove(),b.each((function(t){var e=rt,r=Math.round(lt.c2p(t))+j.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+J).call(d.lineGroupStyle,j.width,Y(t),j.dash)})),yt.selectAll("g."+lt._id+"tick,path").remove();var _=rt+J+(k||0)/2-("outside"===e.ticks?1:0),M=s.calcTicks(lt),T=s.getTickSigns(lt)[2];return s.drawTicks(r,lt,{vals:"inside"===lt.ticks?s.clipEnds(lt,M):M,layer:yt,path:s.makeTickPath(lt,_,T),transFn:s.makeTransTickFn(lt)}),s.drawLabels(r,lt,{vals:M,layer:yt,transFn:s.makeTransTickLabelFn(lt),labelFns:s.makeLabelFns(lt,_)})},function(){if(o&&!ut||!o&&ut){var t,i,a=lt.position||0,s=lt._offset+lt._length/2;if("right"===H)i=s,t=N.l+tt*a+10+mt*(lt.showticklabels?1:.5);else if(t=s,"bottom"===H&&(i=N.t+et*a+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("intside"!==lt.ticks&&e.ticklen||0)),"top"===H){var l=U.text.split("
").length;i=N.t+et*a+10-J-w*mt*l}_t((o?"h":"v")+lt._id+"title",{avoid:{selection:n.select(r).selectAll("g."+lt._id+"tick"),side:H,offsetTop:o?0:N.t,offsetLeft:o?N.l:0,maxShift:o?F.width:F.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=J+k/2;-1===gt.indexOf("inside")&&(n=d.bBox(yt.node()),s+=o?n.width:n.height),pt=vt.select("text");var u=0,f=o&&"top"===H,v=!o&&"right"===H,g=0;if(pt.node()&&!pt.classed(A.jsPlaceholder)){var y,x=vt.select(".h"+lt._id+"title-math-group").node();x&&(o&&ut||!o&&!ut)?(u=(n=d.bBox(x)).width,y=n.height):(u=(n=d.bBox(vt.node())).right-N.l-(o?rt:st),y=n.bottom-N.t-(o?st:rt),o||"top"!==H||(s+=n.height,g=n.height)),v&&(pt.attr("transform",c(u/2+mt/2,0)),u*=2),s=Math.max(s,o?u:y)}var b=2*(o?C:R)+s+L+k/2,w=0;!o&&U.text&&"bottom"===O&&P<=0&&(b+=w=b/2,g+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=g;var B=L+k,j=(o?rt:st)-B/2-(o?C:0),V=(o?st:rt)-(o?Q:R+g-w);t.select("."+A.cbbg).attr("x",j).attr("y",V).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(Q+B,2)).call(p.fill,S).call(p.stroke,e.bordercolor).style("stroke-width",L);var Y=v?Math.max(u-10,0):0;t.selectAll("."+A.cboutline).attr("x",(o?rt:st+C)+Y).attr("y",(o?st+R-Q:rt)+(f?xt:0)).attr(o?"width":"height",Math.max(J,2)).attr(o?"height":"width",Math.max(Q-(o?2*R+xt:2*C+Y),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":k});var G=o?nt*b:0,W=o?0:(1-it)*b-g;if(G=z?N.l-G:-G,W=I?N.t-W:-W,t.attr("transform",c(G,W)),!o&&(L||i(S).getAlpha()&&!i.equals(F.paper_bgcolor,S))){var q=yt.selectAll("text"),X=q[0].length,Z=t.select("."+A.cbbg).node(),K=d.bBox(Z),$=d.getTranslate(t);q.each((function(t,e){var r=X-1;if(0===e||e===r){var n,i=d.bBox(this),a=d.getTranslate(this);if(e===r){var o=i.right+a.x;(n=K.right+$.x+st-L-2+D-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=K.left+$.x+st+L+2-s)<0&&(n=0)}n&&(X<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var tt={},et=M[E],at=T[E],ot=M[O],ct=T[O],ft=b-J;o?("pixels"===h?(tt.y=P,tt.t=Q*ot,tt.b=Q*ct):(tt.t=tt.b=0,tt.yt=P+l*ot,tt.yb=P-l*ct),"pixels"===_?(tt.x=D,tt.l=b*et,tt.r=b*at):(tt.l=ft*et,tt.r=ft*at,tt.xl=D-m*et,tt.xr=D+m*at)):("pixels"===h?(tt.x=D,tt.l=Q*et,tt.r=Q*at):(tt.l=tt.r=0,tt.xl=D+l*et,tt.xr=D-l*at),"pixels"===_?(tt.y=1-P,tt.t=b*ot,tt.b=b*ct):(tt.t=ft*ot,tt.b=ft*ct,tt.yt=P-m*ot,tt.yb=P+m*ct));var ht=e.y<.5?"b":"t",dt=e.x<.5?"l":"r";r._fullLayout._reservedMargin[e._id]={};var bt={r:F.width-j-G,l:j+tt.r,b:F.height-V-W,t:V+tt.b};z&&I?a.autoMargin(r,e._id,tt):z?r._fullLayout._reservedMargin[e._id][ht]=bt[ht]:I||o?r._fullLayout._reservedMargin[e._id][dt]=bt[dt]:r._fullLayout._reservedMargin[e._id][ht]=bt[ht]}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,u=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/u.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/u.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},553:function(t,e,r){"use strict";var n=r(3400);t.exports=function(t){return n.isPlainObject(t.colorbar)}},5080:function(t,e,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:r(616),supplyDefaults:r(4013),draw:r(7848).draw,hasColorbar:r(553)}},9084:function(t,e,r){"use strict";var n=r(616),i=r(3756).counter,a=r(2996),o=r(8304).scales;function s(t){return"`"+t+"`"}a(o),t.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===a,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var d=a+"auto",p=a+"min",v=a+"max",g=a+"mid",m=(s(h+d),s(h+p),s(h+v),{});m[p]=m[v]=void 0;var y={};y[d]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(x.color.anim=!0)),x[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:u,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),x}},7128:function(t,e,r){"use strict";var n=r(8248),i=r(3400),a=r(4288).extractOpts;t.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(e,u).get():e,f=a(c),h=!1!==f.auto,d=f.min,p=f.max,v=f.mid,g=function(){return i.aggNums(Math.min,null,l)},m=function(){return i.aggNums(Math.max,null,l)};void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.min(d,g()):g()),void 0===p?p=m():h&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==v&&(p-v>v-d?d=v-(p-v):p-v=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},5504:function(t,e,r){"use strict";var n=r(3400),i=r(4288).hasColorscale,a=r(4288).extractOpts;t.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},7416:function(t,e,r){"use strict";var n=r(3400),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},2760:function(t,e){"use strict";e.selectMode=function(t){return"lasso"===t||"select"===t},e.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},e.openMode=function(t){return"drawline"===t||"drawopenpath"===t},e.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},e.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},e.selectingOrDrawing=function(t){return e.freeMode(t)||e.rectMode(t)}},6476:function(t,e,r){"use strict";var n=r(9128),i=r(2264),a=r(9184),o=r(3400).removeElement,s=r(3816),l=t.exports={};l.align=r(8316),l.getCursor=r(7416);var u=r(2616);function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,d,p,v,g=t.gd,m=1,y=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,a?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!v){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(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)}p.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=c},2616:function(t,e,r){"use strict";var n=r(5924),i=r(1200),a=r(2200).getGraphDiv,o=r(2456),s=t.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},8192:function(t,e){"use strict";e.u={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},e.c={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},3616:function(t,e,r){"use strict";var n=r(3428),i=r(3400),a=i.numberFormat,o=r(8248),s=r(9760),l=r(4040),u=r(6308),c=r(8932),f=i.strTranslate,h=r(2736),d=r(9616),p=r(4284).LINE_SPACING,v=r(3448).DESELECTDIM,g=r(3028),m=r(7152),y=r(624).appendArrayPointValue,x=t.exports={};function b(t){return"none"===t?void 0:t}x.font=function(t,e){var r=e.variant,n=e.style,i=e.weight,a=e.color,o=e.size,s=e.family,l=e.shadow,c=e.lineposition,f=e.textcase;s&&t.style("font-family",s),o+1&&t.style("font-size",o+"px"),a&&t.call(u.fill,a),i&&t.style("font-weight",i),n&&t.style("font-style",n),r&&t.style("font-variant",r),f&&t.style("text-transform",b(function(t){return _[t]}(f))),l&&t.style("text-shadow","auto"===l?h.makeTextShadow(u.contrast(a)):b(l)),c&&t.style("text-decoration-line",b(function(t){return t.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}(c)))};var _={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function w(t,e,r,n){var i=e.fillpattern,a=e.fillgradient,o=i&&x.getPatternAttr(i.shape,0,"");if(o){var s=x.getPatternAttr(i.bgcolor,0,null),l=x.getPatternAttr(i.fgcolor,0,null),c=i.fgopacity,f=x.getPatternAttr(i.size,0,8),h=x.getPatternAttr(i.solidity,0,.3),d=e.uid;x.pattern(t,"point",r,d,o,f,h,void 0,i.fillmode,s,l,c)}else if(a&&"none"!==a.type){var p,v,g=a.type,m="scatterfill-"+e.uid;n&&(m="legendfill-"+e.uid),n||void 0===a.start&&void 0===a.stop?("horizontal"===g&&(g+="reversed"),t.call(x.gradient,r,m,g,a.colorscale,"fill")):("horizontal"===g?(p={x:a.start,y:0},v={x:a.stop,y:0}):"vertical"===g&&(p={x:0,y:a.start},v={x:0,y:a.stop}),p.x=e._xA.c2p(void 0===p.x?e._extremes.x.min[0].val:p.x,!0),p.y=e._yA.c2p(void 0===p.y?e._extremes.y.min[0].val:p.y,!0),v.x=e._xA.c2p(void 0===v.x?e._extremes.x.max[0].val:v.x,!0),v.y=e._yA.c2p(void 0===v.y?e._extremes.y.max[0].val:v.y,!0),t.call(S,r,m,"linear",a.colorscale,"fill",p,v,!0,!1))}else e.fillcolor&&t.call(u.fill,e.fillcolor)}x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);x.translatePoint(t,i,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,u=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.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||"";u.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(u.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.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},x.singleFillStyle=function(t,e){var r=n.select(t.node());w(t,((r.data()[0]||[])[0]||{}).trace||{},e,!1)},x.fillGroupStyle=function(t,e,r){t.style("stroke-width",0).each((function(t){var i=n.select(this);t[0].trace&&w(i,t[0].trace,e,r)}))};var M=r(1984);x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(M).forEach((function(t){var e=M[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,x.symbolBackOffs[r]=e.backoff||0,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var T=x.symbolNames.length;function A(t,e,r,n){var i=t%100;return x.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(t))t=+t;else 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=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=T||t>=400?0:Math.floor(Math.max(t,0))};var k=a("~f"),L={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function S(t,e,r,a,o,l,c,f,h,d){var p,v=o.length;"linear"===a?p={node:"linearGradient",attrs:{x1:c.x,y1:c.y,x2:f.x,y2:f.y,gradientUnits:h?"userSpaceOnUse":"objectBoundingBox"},reversed:d}:"radial"===a&&(p={node:"radialGradient",reversed:d});for(var g=new Array(v),m=0;m=0&&void 0===t.i&&(t.i=o.i),e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),n.ms2mrc){var c;c="various"===t.ms||"various"===s.size?3:n.ms2mrc(t.ms),t.mrc=c,n.selectedSizeFn&&(c=t.mrc=n.selectedSizeFn(t));var f=x.symbolNumber(t.mx||s.symbol)||0;t.om=f%200>=100;var h=nt(t,r),d=W(t,r);e.attr("d",A(f,c,h,d))}var p,v,g,m=!1;if(t.so)g=l.outlierwidth,v=l.outliercolor,p=s.outliercolor;else{var y=(l||{}).width;g=(t.mlw+1||y+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,v="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(l.color)?u.defaultLine:l.color,i.isArrayOrTypedArray(s.color)&&(p=u.defaultLine,m=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,p).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var b=s.gradient,_=t.mgt;_?m=!0:_=b&&b.type,i.isArrayOrTypedArray(_)&&(_=_[0],L[_]||(_=0));var w=s.pattern,M=w&&x.getPatternAttr(w.shape,t.i,"");if(_&&"none"!==_){var T=t.mgc;T?m=!0:T=b.color;var k=r.uid;m&&(k+="-"+t.i),x.gradient(e,a,k,_,[[0,T],[1,p]],"fill")}else if(M){var S=!1,E=w.fgcolor;!E&&o&&o.color&&(E=o.color,S=!0);var O=x.getPatternAttr(E,t.i,o&&o.color||null),C=x.getPatternAttr(w.bgcolor,t.i,null),R=w.fgopacity,D=x.getPatternAttr(w.size,t.i,8),P=x.getPatternAttr(w.solidity,t.i,.3);S=S||t.mcc||i.isArrayOrTypedArray(w.shape)||i.isArrayOrTypedArray(w.bgcolor)||i.isArrayOrTypedArray(w.fgcolor)||i.isArrayOrTypedArray(w.size)||i.isArrayOrTypedArray(w.solidity);var I=r.uid;S&&(I+="-"+t.i),x.pattern(e,"point",a,I,M,D,P,t.mcc,w.fillmode,C,O,R)}else i.isArrayOrTypedArray(p)?u.fill(e,p[t.i]):u.fill(e,p);g&&u.stroke(e,v)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},u=a.opacity,c=o.opacity,f=s.opacity,h=void 0!==c,d=void 0!==f;(i.isArrayOrTypedArray(u)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?c:e:d?f:v*e});var p=a.color,g=o.color,m=s.color;(g||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?g||e:m||e});var y=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?x/2:e:w?b/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,v))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",A(x.symbolNumber(a),o,nt(n,e),W(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}function P(t,e,r){return r&&(t=j(t)),e?z(t[1]):I(t[0])}function I(t){var e=n.round(t,2);return E=e,e}function z(t){var e=n.round(t,2);return O=e,e}function F(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,f=(u*u*a-l*l*s)*n,h=3*u*(l+u),d=3*l*(l+u);return[[I(e[0]+(h&&c/h)),z(e[1]+(h&&f/h))],[I(e[0]-(d&&c/d)),z(e[1]-(d&&f/d))]]}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,f=c?c(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};u=i.texttemplateString(u,f,l._d3locale,d,t,p)}var v=t.tp||e.textposition,g=D(t,e),m=a?a(t):t.tc||e.textfont.color;o.call(x.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:m}).text(u).call(h.convertToTspans,r).call(R,v,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=D(t,e);u.fill(i,a);var c=l.traceIs(e,"bar-like");R(i,o,s,t.mrc2||t.mrc,c)}))}},x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=u||w>=f&&w<=u)&&(M<=h&&M>=c||M>=h&&M<=c)&&(t=[w,M])}return t}x.steps=function(t){var e=N[t]||B;return function(t){for(var r="M"+I(t[0][0])+","+z(t[0][1]),n=t.length,i=1;i=1e4&&(x.savedBBoxes={},U=0),r&&(x.savedBBoxes[r]=g),U++,i.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",V(e,r))},x.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}},x.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+=f(e,r)).trim(),t[i]("transform",a),a},x.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}},x.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};var Y=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var G=/translate\([^)]*\)\s*$/;function W(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.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(G);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},x.getMarkerStandoff=W;var q,X,Z,J,K,Q,$=Math.atan2,tt=Math.cos,et=Math.sin;function rt(t,e){var r=e[0],n=e[1];return[r*tt(t)-n*et(t),r*et(t)+n*tt(t)]}function nt(t,e){var r,n,a=t.ma;void 0===a&&((a=e.marker.angle)&&!i.isArrayOrTypedArray(a)||(a=0));var s=e.marker.angleref;if("previous"===s||"north"===s){if(e._geo){var l=e._geo.project(t.lonlat);r=l[0],n=l[1]}else{var u=e._xA,c=e._yA;if(!u||!c)return 90;r=u.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var f,h=t.lonlat[0],d=t.lonlat[1],p=e._geo.project([h,d+1e-5]),v=e._geo.project([h+1e-5,d]),g=$(v[1]-n,v[0]-r),m=$(p[1]-n,p[0]-r);if("north"===s)f=a/180*Math.PI;else if("previous"===s){var y=h/180*Math.PI,x=d/180*Math.PI,b=q/180*Math.PI,_=X/180*Math.PI,w=b-y,M=tt(_)*et(w),T=et(_)*tt(x)-tt(_)*et(x)*tt(w);f=-$(M,T)-Math.PI,q=h,X=d}var A=rt(g,[tt(f),0]),k=rt(m,[et(f),0]);a=$(A[1]+k[1],A[0]+k[0])/Math.PI*180,"previous"!==s||Q===e.uid&&t.i===K+1||(a=null)}if("previous"===s&&!e._geo)if(Q===e.uid&&t.i===K+1&&o(r)&&o(n)){var L=r-Z,S=n-J,E=e.line&&e.line.shape||"",O=E.slice(E.length-1);"h"===O&&(S=0),"v"===O&&(L=0),a+=$(S,L)/Math.PI*180+90}else a=null}return Z=r,J=n,K=t.i,Q=e.uid,a}x.getMarkerAngle=nt},1984:function(t,e,r){"use strict";var n,i,a,o,s=r(9604),l=r(3428).round,u="M0,0Z",c=Math.sqrt(2),f=Math.sqrt(3),h=Math.PI,d=Math.cos,p=Math.sin;function v(t){return null===t}function g(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=d(t),i=p(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var u=t/180*h,c=0,f=0,v=s(r),g="",m=0;m0,f=t._context.staticPlot;e.each((function(e){var h,d=e[0].trace,p=d.error_x||{},v=d.error_y||{};d.ids&&(h=function(t){return t.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;v.visible||p.visible||(e=[]);var m=n.select(this).selectAll("g.errorbar").data(e,h);if(m.exit().remove(),e.length){p.visible||m.selectAll("path.xerror").remove(),v.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var y=m.enter().append("g").classed("errorbar",!0);c&&y.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(m,r.layerClipId,t),m.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}(t,l,u);if(!g||t.vis){var a,o=e.select("path.yerror");if(v.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var h=v.width;a="M"+(r.x-h)+","+r.yh+"h"+2*h+"m-"+h+",0V"+r.ys,r.noYS||(a+="m-"+h+",0h"+2*h),o.size()?c&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect",f?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var d=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var m=(p.copy_ystyle?v:p).width;a="M"+r.xh+","+(r.y-m)+"v"+2*m+"m0,-"+m+"H"+r.xs,r.noXS||(a+="m0,-"+m+"v"+2*m),d.size()?c&&(d=d.transition().duration(s.duration).ease(s.easing)):d=e.append("path").style("vector-effect",f?"none":"non-scaling-stroke").classed("xerror",!0),d.attr("d",a)}else d.remove()}}))}}))}},2036:function(t,e,r){"use strict";var n=r(3428),i=r(6308);t.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},5756:function(t,e,r){"use strict";var n=r(5376),i=r(5460).hoverlabel,a=r(2880).extendFlat;t.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},5056:function(t,e,r){"use strict";var n=r(3400),i=r(4040);function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}t.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexJ[0]._length||_t<0||_t>K[0]._length)return v.unhoverRaw(t,e)}else bt="xpx"in e?e.xpx:J[0]._length/2,_t="ypx"in e?e.ypx:K[0]._length/2;if(e.pointerX=bt+J[0]._offset,e.pointerY=_t+K[0]._offset,nt="xval"in e?x.flat(b,e.xval):x.p2c(J,bt),it="yval"in e?x.flat(b,e.yval):x.p2c(K,_t),!i(nt[0])||!i(it[0]))return o.warn("Fx.hover failed",e,t),v.unhoverRaw(t,e)}var At=1/0;function kt(r,n){for(ot=0;otvt&&(gt.splice(0,vt),At=gt[0].distance),k&&0!==rt&&0===gt.length){pt.distance=rt,pt.index=!1;var c=lt._module.hoverPoints(pt,ht,dt,"closest",{hoverLayer:_._hoverlayer});if(c&&(c=c.filter((function(t){return t.spikeDistance<=rt}))),c&&c.length){var f,h=c.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(h.length){var d=h[0];i(d.x0)&&i(d.y0)&&(f=St(d),(!yt.vLinePoint||yt.vLinePoint.spikeDistance>f.spikeDistance)&&(yt.vLinePoint=f))}var v=c.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var g=v[0];i(g.x0)&&i(g.y0)&&(f=St(g),(!yt.hLinePoint||yt.hLinePoint.spikeDistance>f.spikeDistance)&&(yt.hLinePoint=f))}}}}}function Lt(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Bt-1;jt--)Yt(gt[jt]);gt=Ut,Rt()}var Gt=t._hoverdata,Wt=[],qt=Y(t),Xt=G(t);for(at=0;at1||gt.length>1)||"closest"===L&&xt&>.length>1,se=p.combine(_.plot_bgcolor||p.background,_.paper_bgcolor),le=I(gt,{gd:t,hovermode:L,rotateLabels:oe,bgColor:se,container:_._hoverlayer,outerContainer:_._paper.node(),commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance}),ue=le.hoverLabels;if(x.isUnifiedHover(L)||(function(t,e,r,n){var i,a,o,s,l,u,c,f=e?"xa":"ya",h=e?"ya":"xa",d=0,p=1,v=t.size(),g=new Array(v),m=0,y=n.minX,x=n.maxX,b=n.minY,_=n.maxY,w=function(t){return t*r._invScaleX},M=function(t){return t*r._invScaleY};function T(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(u=t[s]).pos>e.pmax-1&&(u.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(u=t[s]).pos+u.dp+u.size>e.pmax&&(u.del=!0,n--)}}}for(t.each((function(t){var n=t[f],i=t[h],a="x"===n._id.charAt(0),o=n.range;0===m&&o&&o[0]>o[1]!==a&&(p=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var u,c,d=F(t,e),v=t.anchor,T="end"===v?-1:1;if("middle"===v)c=(u=t.crossPos+(a?M(d.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?M(t.by):w(t.bx));else if(a)c=(u=t.crossPos+M(S+d.y)-M(t.by/2-S))+M(t.by);else{var k=w(T*S+d.x),L=k+w(T*t.bx);u=t.crossPos+Math.min(k,L),c=t.crossPos+Math.max(k,L)}a?void 0!==b&&void 0!==_&&Math.min(c,_)-Math.max(u,b)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==y&&void 0!==x&&Math.min(c,x)-Math.max(u,y)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[m++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:s,pmax:l}]})),g.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));!i&&d<=v;){for(d++,i=!0,s=0;s.01){for(l=L.length-1;l>=0;l--)L[l].dp+=a;for(k.push.apply(k,L),g.splice(s+1,1),c=0,l=k.length-1;l>=0;l--)c+=k[l].dp;for(o=c/k.length,l=k.length-1;l>=0;l--)k[l].dp-=o;i=!1}else s++}g.forEach(T)}for(s=g.length-1;s>=0;s--){var C=g[s];for(l=C.length-1;l>=0;l--){var R=C[l],D=R.datum;D.offset=R.dp,D.del=R.del}}}(ue,oe,_,le.commonLabelBoundingBox),N(ue,oe,_._invScaleX,_._invScaleY)),l&&l.tagName){var ce=y.getComponentMethod("annotations","hasClickToShow")(t,Wt);h(n.select(l),ce?"pointer":"")}l&&!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)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Gt)&&(Gt&&t.emit("plotly_unhover",{event:e,points:Gt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:J,yaxes:K,xvals:nt,yvals:it}))}(t,e,r,a,l)}))},e.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=Y(i),o=G(i),s=I(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),v=t.trace;if(y.traceIs(v,"gl3d")){var g=i._fullLayout[v.scene]._scene.container,m=g.offsetLeft,x=g.offsetTop;c+=m,f+=m,h+=x,d+=x}u.bbox={x0:c+o,x1:f+o,y0:h+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||p.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,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}).hoverLabels,l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function I(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,c=e.bgColor,h=e.container,v=e.outerContainer,g=e.commonLabelOpts||{};if(0===t.length)return[[]];var m=e.fontFamily||b.HOVERFONT,T=e.fontSize||b.HOVERFONTSIZE,A=e.fontWeight||i.font.weight,k=e.fontStyle||i.font.style,L=e.fontVariant||i.font.variant,O=e.fontTextcase||i.font.textcase,C=e.fontLineposition||i.font.lineposition,R=e.fontShadow||i.font.shadow,P=t[0],I=P.xa,F=P.ya,N=a.charAt(0),B=N+"Label",j=P[B];if(void 0===j&&"multicategory"===I.type)for(var U=0;Ui.width-M&&(D=i.width-M),e.attr("d","M"+(x-D)+",0L"+(x-D+S)+","+w+S+"H"+M+"v"+w+(2*E+_.height)+"H"+-M+"V"+w+S+"H"+(x-D-S)+"Z"),x=D,$.minX=x-M,$.maxX=x+M,"top"===I.side?($.minY=b-(2*E+_.height),$.maxY=b-E):($.minY=b+E,$.maxY=b+(2*E+_.height))}else{var z,N,B;"right"===F.side?(z="start",N=1,B="",x=I._offset+I._length):(z="end",N=-1,B="-",x=I._offset),b=F._offset+(P.y0+P.y1)/2,s.attr("text-anchor",z),e.attr("d","M0,0L"+B+S+","+S+"V"+(E+_.height/2)+"h"+B+(2*E+_.width)+"V-"+(E+_.height/2)+"H"+B+S+"V-"+S+"Z"),$.minY=b-(E+_.height/2),$.maxY=b+(E+_.height/2),"right"===F.side?($.minX=x+S,$.maxX=x+S+(2*E+_.width)):($.minX=x-S-(2*E+_.width),$.maxX=x-S);var U,H=_.height/2,Y=V-_.top-H,G="clip"+i._uid+"commonlabel"+F._id;if(x<_.width+2*E+S){U="M-"+(S+E)+"-"+H+"h-"+(_.width-E)+"V"+H+"h"+(_.width-E)+"Z";var q=_.width-x+E;f.positionText(s,q,Y),"end"===z&&s.selectAll("tspan").each((function(){var t=n.select(this),e=d.tester.append("text").text(t.text()).call(d.font,y),i=W(r,e.node());Math.round(i.width)=0?pt:vt+yt=0?vt:kt+yt=0?ht:dt+xt=0?dt:Lt+xt=0,"top"!==t.idealAlign&&K||!Q?K?(B+=H/2,t.anchor="start"):t.anchor="middle":(B-=H/2,t.anchor="end"),t.crossPos=B;else{if(t.pos=B,K=N+U/2+$<=Y,Q=N-U/2-$>=0,"left"!==t.idealAlign&&K||!Q)if(K)N+=U/2,t.anchor="start";else{t.anchor="middle";var tt=$/2,et=N+tt-Y,rt=N-tt;et>0&&(N-=et),rt<0&&(N+=-rt)}else N-=U/2,t.anchor="end";t.crossPos=N}w.attr("text-anchor",t.anchor),P&&D.attr("text-anchor",t.anchor),e.attr("transform",l(N,B)+(s?u(M):""))})),{hoverLabels:St,commonLabelBoundingBox:$}}function z(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=H(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===i?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[u+"Label"]!==i&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=H(r,t.nameLength),""}))}return[l,s]}function F(t,e){var r=0,n=t.offset;return e&&(n*=-L,r=t.offset*k),{x:r,y:n}}function N(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i,s,l,u,c=r.select("text.nums"),h=t.anchor,p="end"===h?-1:1,v=(u=(l=(s={start:1,end:-1,middle:0}[(i=t).anchor])*(S+E))+s*(i.txwidth+E),"middle"===i.anchor&&(l-=i.tx2width/2,u+=i.txwidth/2+E),{alignShift:s,textShiftX:l,text2ShiftX:u}),g=F(t,e),m=g.x,y=g.y,x="middle"===h;r.select("path").attr("d",x?"M-"+a(t.bx/2+t.tx2width/2)+","+o(y-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(p*S+m)+","+o(S+y)+"v"+o(t.by/2-S)+"h"+a(p*t.bx)+"v-"+o(t.by)+"H"+a(p*S+m)+"V"+o(y-S)+"Z");var b=m+v.textShiftX,_=y+t.ty0-t.by/2+E,w=t.textAlign||"auto";"auto"!==w&&("left"===w&&"start"!==h?(c.attr("text-anchor","start"),b=x?-t.bx/2-t.tx2width/2+E:-t.bx-E):"right"===w&&"end"!==h&&(c.attr("text-anchor","end"),b=x?t.bx/2-t.tx2width/2-E:t.bx+E)),c.call(f.positionText,a(b),o(_)),t.tx2width&&(r.select("text.name").call(f.positionText,a(v.text2ShiftX+v.alignShift*E+m),o(y+t.ty0-t.by/2+E)),r.select("rect").call(d.setRect,a(v.text2ShiftX+(v.alignShift-1)*t.tx2width/2+m),o(y-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function B(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("fontWeight","htw","hoverlabel.font.weight"),c("fontStyle","hty","hoverlabel.font.style"),c("fontVariant","htv","hoverlabel.font.variant"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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 f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function j(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var h=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=i._offset+y.y);var x,b,_=a.readability(y.color,h)<1.5?p.contrast(h):y.color,w=i.spikemode,M=i.spikethickness,T=i.spikecolor||_,A=g.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,b=v),-1!==w.indexOf("across")){var k=i._counterDomainMin,L=i._counterDomainMax;"free"===i.anchor&&(k=Math.min(k,i.position),L=Math.max(L,i.position)),x=l.l+k*l.w,b=l.l+L*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":M,stroke:T,"stroke-dasharray":d.dashStyle(i.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":M+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?M:-M),cy:m,r:M,fill:T}).classed("spikeline",!0)}if(f){var S,E,O=e.vLinePoint;n=O&&O.xa,i=O&&O.ya,"cursor"===n.spikesnap?(S=u.pointerX,E=u.pointerY):(S=n._offset+O.x,E=i._offset+O.y);var C,R,D=a.readability(O.color,h)<1.5?p.contrast(h):O.color,P=n.spikemode,I=n.spikethickness,z=n.spikecolor||D,F=g.getPxPosition(t,n);if(-1!==P.indexOf("toaxis")||-1!==P.indexOf("across")){if(-1!==P.indexOf("toaxis")&&(C=F,R=E),-1!==P.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),C=l.t+(1-B)*l.h,R=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:R,"stroke-width":I,stroke:z,"stroke-dasharray":d.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:R,"stroke-width":I+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==P.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?I:-I),r:I,fill:z}).classed("spikeline",!0)}}}function U(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function H(t,e){return f.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function V(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?i+=c:"middle"===o&&(i+=c/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function Y(t){return t.offsetTop+t.clientTop}function G(t){return t.offsetLeft+t.clientLeft}function W(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.left,a=n.top,s=i+n.width,l=a+n.height,u=o.apply3DTransform(r._invTransform)(i,a),c=o.apply3DTransform(r._invTransform)(s,l),f=u[0],h=u[1],d=c[0],p=c[1];return{x:f,y:h,width:d-f,height:p-h,top:Math.min(h,p),left:Math.min(f,d),right:Math.max(f,d),bottom:Math.max(h,p)}}},6132:function(t,e,r){"use strict";var n=r(3400),i=r(6308),a=r(624).isUnifiedHover;t.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},1008:function(t,e,r){"use strict";var n=r(3400),i=r(5460);t.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hoversubplots"),r("hovermode")}},3024:function(t,e,r){"use strict";var n=r(3428),i=r(3400),a=r(6476),o=r(624),s=r(5460),l=r(3292);t.exports={moduleType:"component",name:"fx",constants:r(2456),schema:{layout:s},attributes:r(5756),layoutAttributes:s,supplyLayoutGlobalDefaults:r(1976),supplyDefaults:r(5448),supplyLayoutDefaults:r(8336),calc:r(5056),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:r(2376)}},5460:function(t,e,r){"use strict";var n=r(2456),i=r(5376),a=i({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},8336:function(t,e,r){"use strict";var n=r(3400),i=r(5460),a=r(1008),o=r(6132);t.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},1976:function(t,e,r){"use strict";var n=r(3400),i=r(6132),a=r(5460);t.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},2704:function(t,e,r){"use strict";var n=r(3400),i=r(3756).counter,a=r(6968).u,o=r(3816).idRegex,s=r(1780),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),u=s[0],c=(s[1]-u)/(i-o),f=c*(1-o),h=0;h1){h||d||p||"independent"===T("pattern")&&(h=!0),g._hasSubplotGrid=h;var x,b,_="top to bottom"===T("roworder"),w=h?.2:.1,M=h?.3:.1;v&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:c("x",T,w,x,y),y:c("y",T,M,b,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,v=r.rows,g=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var x=h.subplots||[];l=r.subplots=new Array(v);var b=1;for(n=0;n("legend"===t?1:0));if(!1===k&&(r[t]=void 0),(!1!==k||f.uirevision)&&(d("uirevision",r.uirevision),!1!==k)){d("borderwidth");var L,S,E,O="h"===d("orientation"),C="paper"===d("yref"),R="paper"===d("xref"),D="left";if(O?(L=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?C?(S=1.1,E="bottom"):(S=1,E="top"):C?(S=-.1,E="top"):(S=0,E="bottom")):(S=1,E="auto",R?L=1.02:(L=1,D="right")),i.coerce(f,h,{x:{valType:"number",editType:"legend",min:R?-2:0,max:R?3:1,dflt:L}},"x"),i.coerce(f,h,{y:{valType:"number",editType:"legend",min:C?-2:0,max:C?3:1,dflt:S}},"y"),d("traceorder",_),u.isGrouped(r[t])&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("indentation"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("xanchor",D),d("yanchor",E),d("valign"),i.noneOrAll(f,h,["x","y"]),d("title.text")){d("title.side",O?"left":"top");var P=i.extendFlat({},p,{size:i.bigFont(p.size)});i.coerceFont(d,"title.font",P)}}}}t.exports=function(t,e,r){var n,a=r.slice(),o=e.shapes;if(o)for(n=0;n1)}var N=p.hiddenlabels||[];if(!(M||p.showlegend&&L.length))return s.selectAll("."+w).remove(),p._topdefs.select("#"+r).remove(),a.autoMargin(t,w);var B=i.ensureSingle(s,"g",w,(function(t){M||t.attr("pointer-events","all")})),j=i.ensureSingleById(p._topdefs,"clipPath",r,(function(t){t.append("rect")})),U=i.ensureSingle(B,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));U.call(c.stroke,h.bordercolor).call(c.fill,h.bgcolor).style("stroke-width",h.borderwidth+"px");var H,V=i.ensureSingle(B,"g","scrollbox"),Y=h.title;h._titleWidth=0,h._titleHeight=0,Y.text?((H=i.ensureSingle(V,"text",w+"titletext")).attr("text-anchor","start").call(u.font,Y.font).text(Y.text),E(H,V,t,h,_)):V.selectAll("."+w+"titletext").remove();var G=i.ensureSingle(B,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(c.fill,d.scrollBarColor)})),W=V.selectAll("g.groups").data(L);W.enter().append("g").attr("class","groups"),W.exit().remove();var q=W.selectAll("g.traces").data(i.identity);q.enter().append("g").attr("class","traces"),q.exit().remove(),q.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==N.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(k,t,h)})).call(x,t,h).each((function(){M||n.select(this).call(S,t,w)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout,o=R(i);i||(i=a[o]);var s=a._size,l=b.isVertical(i),c=b.isGrouped(i),f="fraction"===i.entrywidthmode,h=i.borderwidth,p=2*h,v=d.itemGap,g=i.indentation+i.itemwidth+2*v,m=2*(h+v),y=C(i),x=i.y<0||0===i.y&&"top"===y,_=i.y>1||1===i.y&&"bottom"===y,w=i.tracegroupgap,M={};i._maxHeight=Math.max(x||_?a.height/2:s.h,30);var A=0;i._width=0,i._height=0;var k=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(l)r.each((function(t){var e=t[0].height;u.setTranslate(this,h+k[0],h+k[1]+i._height+e/2+v),i._height+=e,i._width=Math.max(i._width,t[0].width)})),A=g+i._width,i._width+=v+g+p,i._height+=m,c&&(e.each((function(t,e){u.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var L=O(i),S=i.x<0||0===i.x&&"right"===L,E=i.x>1||1===i.x&&"left"===L,D=_||x,P=a.width/2;i._maxWidth=Math.max(S?D&&"left"===L?s.l+s.w:P:E?D&&"right"===L?s.r+s.w:P:s.w,2*g);var I=0,z=0;r.each((function(t){var e=T(t,i,g);I=Math.max(I,e),z+=e})),A=null;var F=0;if(c){var N=0,B=0,j=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=T(r,i,g),a=r[0].height;u.setTranslate(this,k[0],k[1]+h+v+a/2+e),e+=a,t=Math.max(t,n),M[r[0].trace.legendgroup]=t}));var r=t+v;B>0&&r+h+B>i._maxWidth?(F=Math.max(F,B),B=0,j+=N+w,N=e):N=Math.max(N,e),u.setTranslate(this,B,j),B+=r})),i._width=Math.max(F,B)+h,i._height=j+N+m}else{var U=r.size(),H=z+p+(U-1)*v=i._maxWidth&&(F=Math.max(F,W),Y=0,G+=V,i._height+=V,V=0),u.setTranslate(this,k[0]+h+Y,k[1]+h+G+e/2+v),W=Y+r+v,Y+=n,V=Math.max(V,e)})),H?(i._width=Y+p,i._height=V+m):(i._width=Math.max(F,W)+p,i._height+=V+m)}}i._width=Math.ceil(Math.max(i._width+k[0],i._titleWidth+2*(h+d.titlePad))),i._height=Math.ceil(Math.max(i._height+k[1],i._titleHeight+2*(h+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var q=t._context.edits,X=q.legendText||q.legendPosition;r.each((function(t){var e=n.select(this).select("."+o+"toggle"),r=t[0].height,a=t[0].trace.legendgroup,s=T(t,i,g);c&&""!==a&&(s=M[a]);var h=X?g:A||s;l||f||(h+=v/2),u.setRect(e,0,-r/2,h,r)}))}(t,W,q,h)},function(){var e,c,y,x,b=p._size,_=h.borderwidth,T="paper"===h.xref,k="paper"===h.yref;if(Y.text&&function(t,e,r){if("top center"===e.title.side||"top right"===e.title.side){var n=e.title.font.size*v,i=0,a=t.node(),o=u.bBox(a).width;"top center"===e.title.side?i=.5*(e._width-2*r-2*d.titlePad-o):"top right"===e.title.side&&(i=e._width-2*r-2*d.titlePad-o),f.positionText(t,r+d.titlePad+i,r+n)}}(H,h,_),!M){var L,S;L=T?b.l+b.w*h.x-g[O(h)]*h._width:p.width*h.x-g[O(h)]*h._width,S=k?b.t+b.h*(1-h.y)-g[C(h)]*h._effHeight:p.height*(1-h.y)-g[C(h)]*h._effHeight;var E=function(t,e,r,n){var i=t._fullLayout,o=i[e],s=O(o),l=C(o),u="paper"===o.xref,c="paper"===o.yref;t._fullLayout._reservedMargin[e]={};var f=o.y<.5?"b":"t",h=o.x<.5?"l":"r",d={r:i.width-r,l:r+o._width,b:i.height-n,t:n+o._effHeight};if(u&&c)return a.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*g[s],r:o._width*m[s],b:o._effHeight*m[l],t:o._effHeight*g[l]});u?t._fullLayout._reservedMargin[e][f]=d[f]:c||"v"===o.orientation?t._fullLayout._reservedMargin[e][h]=d[h]:t._fullLayout._reservedMargin[e][f]=d[f]}(t,w,L,S);if(E)return;if(p.margin.autoexpand){var R=L,D=S;L=T?i.constrain(L,0,p.width-h._width):R,S=k?i.constrain(S,0,p.height-h._effHeight):D,L!==R&&i.log("Constrain "+w+".x to make legend fit inside graph"),S!==D&&i.log("Constrain "+w+".y to make legend fit inside graph")}u.setTranslate(B,L,S)}if(G.on(".drag",null),B.on("wheel",null),M||h._height<=h._maxHeight||t._context.staticPlot){var P=h._effHeight;M&&(P=h._height),U.attr({width:h._width-_,height:P-_,x:_/2,y:_/2}),u.setTranslate(V,0,0),j.select("rect").attr({width:h._width-2*_,height:P-2*_,x:_,y:_}),u.setClipUrl(V,r,t),u.setRect(G,0,0,0,0),delete h._scrollY}else{var I,z,F,N=Math.max(d.scrollBarMinHeight,h._effHeight*h._effHeight/h._height),W=h._effHeight-N-2*d.scrollBarMargin,q=h._height-h._effHeight,X=W/q,Z=Math.min(h._scrollY||0,q);U.attr({width:h._width-2*_+d.scrollBarWidth+d.scrollBarMargin,height:h._effHeight-_,x:_/2,y:_/2}),j.select("rect").attr({width:h._width-2*_+d.scrollBarWidth+d.scrollBarMargin,height:h._effHeight-2*_,x:_,y:_+Z}),u.setClipUrl(V,r,t),Q(Z,N,X),B.on("wheel",(function(){Q(Z=i.constrain(h._scrollY+n.event.deltaY/W*q,0,q),N,X),0!==Z&&Z!==q&&n.event.preventDefault()}));var J=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;I="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=Z})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(z="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Z=function(t,e,r){var n=(r-e)/X+t;return i.constrain(n,0,q)}(F,I,z),Q(Z,N,X))}));G.call(J);var K=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(I=t.changedTouches[0].clientY,F=Z)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(z=t.changedTouches[0].clientY,Z=function(t,e,r){var n=(e-r)/X+t;return i.constrain(n,0,q)}(F,I,z),Q(Z,N,X))}));V.call(K)}function Q(e,r,n){h._scrollY=t._fullLayout[w]._scrollY=e,u.setTranslate(V,0,-e),u.setRect(G,h._width,d.scrollBarMargin+e*n,d.scrollBarWidth,r),j.select("rect").attr("y",_+e)}t._context.edits.legendPosition&&(B.classed("cursor-move",!0),l.init({element:B.node(),gd:t,prepFn:function(t){if(t.target!==G.node()){var e=u.getTranslate(B);y=e.x,x=e.y}},moveFn:function(t,r){if(void 0!==y&&void 0!==x){var n=y+t,i=x+r;u.setTranslate(B,n,i),e=l.align(n,h._width,b.l,b.l+b.w,h.xanchor),c=l.align(i+h._height,-h._height,b.t+b.h,b.t,h.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==c){var r={};r[w+".x"]=e,r[w+".y"]=c,o.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=s.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom}));n.size()>0&&A(t,B,n,e,r)}}))}],t)}}function T(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function A(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label);var u=s.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===u)return;e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&!1!==u&&h(r,t,n))}function k(t,e,r){var n,a,s=R(r),l=t.data()[0][0],c=l.trace,h=o.traceIs(c,"pie-like"),p=!r._inHover&&e._context.edits.legendText&&!h,v=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,a=l.groupTitle.font):(a=r.font,r.entries?n=l.text:(n=h?l.label:c.name,c._meta&&(n=i.templateString(n,c._meta))));var g=i.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(u.font,a).text(p?L(n,v):n);var m=r.indentation+r.itemwidth+2*d.itemGap;f.positionText(g,m,0),p?g.call(f.makeEditable,{gd:e,text:n}).call(E,t,e,r).on("edit",(function(n){this.text(L(n,v)).call(E,t,e,r);var a=l.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(l.trace._group,n),s=h.constructUpdate()}else s.name=n;return a._isShape?o.call("_guiRelayout",e,"shapes["+c.index+"].name",s.name):o.call("_guiRestyle",e,s,c.index)})):E(g,t,e,r)}function L(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e,r){var a,o=e._context.doubleClickDelay,s=1,l=i.ensureSingle(t,"rect",r+"toggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-e._legendMouseDownTimeo&&(s=Math.max(s-1,1)),A(e,i,t,s,n.event)}})))}function E(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select("g[class*=math-group]"),o=a.node(),s=R(r);r||(r=e._fullLayout[s]);var l,c,h=r.borderwidth,p=(n===_?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*v;if(o){var g=u.bBox(o);l=g.height,c=g.width,n===_?u.setTranslate(a,h,h+.75*l):u.setTranslate(a,0,.25*l)}else{var m="."+s+(n===_?"title":"")+"text",y=t.select(m),x=f.lineCount(y),b=y.node();if(l=p*x,c=b?u.bBox(b).width:0,n===_)"left"===r.title.side&&(c+=2*d.itemGap),f.positionText(y,h+d.titlePad,h+p);else{var w=2*d.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(w=d.itemGap,c-=r.indentation+r.itemwidth),f.positionText(y,w,-p*((x-1)/2-.3))}}n===_?(r._titleWidth=c,r._titleHeight=l):(i.lineHeight=p,i.height=Math.max(l,16)+3,i.width=c)}else t.remove()}(e,r,n,i)}))}function O(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function C(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}function R(t){return t._id||"legend"}t.exports=function(t,e){if(e)M(t,e);else{var r=t._fullLayout,i=r._legends;r._infolayer.selectAll('[class^="legend"]').each((function(){var t=n.select(this),e=t.attr("class").split(" ")[0];e.match(w)&&-1===i.indexOf(e)&&t.remove()}));for(var a=0;aL&&(k=L)}T[a][0]._groupMinRank=k,T[a][0]._preGroupSort=a}var S=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(T.forEach((function(t,e){t[0]._preGroupSort=e})),T.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),a=0;ar?r:t}t.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*d.itemGap)/2,_=o(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function M(t,a,o){var c=t[0].trace,f=c.marker||{},h=f.line||{},d=f.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",p=o?c.visible&&c.type===o:i.traceIs(c,"bar"),v=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);v.enter().append("path").classed("legend"+o,!0).attr("d",d).attr("transform",_),v.exit().remove(),v.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var d=a.mcc;if(!r._inHover&&"mc"in a){var p=u(f),v=p.mid;void 0===v&&(v=(p.max+p.min)/2),d=s.tryColorscale(f,"")(v)}var m=d||a.mc||f.color,y=f.pattern,x=y&&s.getPatternAttr(y.shape,0,"");if(x){var b=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,T=g(y.size,8,10),A=g(y.solidity,.5,1),k="legend-"+c.uid;i.call(s.pattern,"legend",e,k,x,T,A,d,y.fillmode,b,_,M)}else i.call(l.fill,m);o&&l.stroke(i,a.mlc||h.color)}))}function T(t,r,o){var s=t[0],l=s.trace,u=o?l.visible&&l.type===o:i.traceIs(l,o),c=n.select(r).select("g.legendpoints").selectAll("path.legend"+o).data(u?[t]:[]);if(c.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var d=l.marker||{},p=w(h(d.line.width,s.pts),d.line,5,2),v="pieLike",g=a.minExtend(l,{marker:{line:{width:p}}},v),m=a.minExtend(s,{trace:g},v);f(c,m,g,e)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.indentation,l=r.valign,u=t[0].lineHeight,c=t[0].height;if("middle"===l&&0===s||!u||!c)i.attr("transform",null);else{var f={top:1,bottom:-1}[l]*(.5*(u-c+3))||0,h=r.indentation;i.attr("transform",o(h,f))}i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var d=i.selectAll("g.legendsymbols").data([t]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,f=n.select(this),h=u(i),d=h.colorscale,v=h.reversescale;if(d){if(!r){var g=d.length;c=0===o?d[v?g-1:0][1]:1===o?d[v?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var m=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),c?f.call(l.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,p(v,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,M(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){M(t,this,"funnel")})).each((function(t){M(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var r,i,o=v(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,g=o.anyFill,m=o.anyLine,y=t[0],b=y.trace,_=u(b),M=_.colorscale,T=_.reversescale,A=c.hasMarkers(b)||!g?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),L=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",A+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e,!0);else{var r="legendfill-"+b.uid;s.gradient(t,e,r,p(T),M,"fill")}})),f||h){var S=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:S}}),r=[a.minExtend(y,{trace:i})]}var E=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",A+(h?"l"+x+",0.0001":"h"+x)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(T),M,"stroke")}})})).each((function(t){var r,i,o=v(t),l=o.anyFill,u=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,g=!h&&!u&&!l&&c.hasText(p);function m(t,e,r,n){var i=a.nestedProperty(p,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||g||f){var b={},w={};if(h){b.mc=m("marker.color",x),b.mx=m("marker.symbol",x),b.mo=m("marker.opacity",a.mean,[.2,1]),b.mlc=m("marker.line.color",x),b.mlw=m("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",a.mean,[2,16],12);b.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=m("textposition",x),b.ts=10,b.tc=m("textfont.color",x),b.tf=m("textfont.family",x),b.tw=m("textfont.weight",x),b.ty=m("textfont.style",x),b.tv=m("textfont.variant",x),b.tC=m("textfont.textcase",x),b.tE=m("textfont.lineposition",x),b.tS=m("textfont.shadow",x)),r=[a.minExtend(d,b)],(i=a.minExtend(p,w)).selectedpoints=null,i.texttemplate=null}var T=n.select(this).select("g.legendpoints"),A=T.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var k=T.selectAll("g.pointtext").data(g?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},6540:function(t,e,r){"use strict";r(6052),t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},1868:function(t,e,r){"use strict";var n=r(4040),i=r(7316),a=r(9811),o=r(9224),s=r(4016).eraseActiveShape,l=r(3400),u=l._,c=t.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,v=(1+p)/2,g=(1-p)/2;for(i=0;i1?(R=["toggleHover"],D=["resetViews"]):m?(C=["zoomInGeo","zoomOutGeo"],R=["hoverClosestGeo"],D=["resetGeo"]):g?(R=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],R=["toggleHover"],D=["resetViewMapbox"]):b?R=["hoverClosestGl2d"]:y?R=["hoverClosestPie"]:A?(R=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):R=["toggleHover"],v&&R.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var e=0;e0)){var v=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a0?t.touches[0].clientX:0}function m(t,e,r,n){var i=o.ensureSingle(t,"rect",v.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,c=-n._offsetShift,f=l.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:s(c,c),"stroke-width":f}).call(u.stroke,n.bordercolor).call(u.fill,n.bgcolor)}function y(t,e,r,n){var i=e._fullLayout;o.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function x(t,e,r,i){var s,u=e.calcdata,c=t.selectAll("g."+v.rangePlotClassName).data(r._subplotsWith,o.identity);c.enter().append("g").attr("class",(function(t){return v.rangePlotClassName+" "+t})).call(l.setClipUrl,i._clipId,e),c.order(),c.exit().remove(),c.each((function(t,o){var l=n.select(this),c=0===o,d=h.getFromId(e,t,"y"),p=d._name,v=i[p],g={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:i.range.slice(),calendar:r.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};r.rangebreaks&&(g.layout.xaxis.rangebreaks=r.rangebreaks),g.layout[p]={type:d.type,domain:[0,1],range:"match"!==v.rangemode?v.range.slice():d.range.slice(),calendar:d.calendar},d.rangebreaks&&(g.layout[p].rangebreaks=d.rangebreaks),a.supplyDefaults(g);var m=g._fullLayout.xaxis,y=g._fullLayout[p];m.clearCalc(),m.setScale(),y.clearCalc(),y.setScale();var x={id:t,plotgroup:l,xaxis:m,yaxis:y,isRangePlot:!0};c?s=x:(x.mainplot="xy",x.mainplotinfo=s),f.rangePlot(e,x,function(t,e){for(var r=[],n=0;n=n.max)e=N[r+1];else if(t=n.pmax)e=N[r+1];else if(tr._length||y+_<0)return;c=m+_,d=y+_;break;case l:if(b="col-resize",m+_>r._length)return;c=m+_,d=y;break;case u:if(b="col-resize",y+_<0)return;c=m,d=y+_;break;default:b="ew-resize",c=v,d=v+_}if(d=0;T--){var A=r.append("path").attr(g).style("opacity",T?.1:m).call(o.stroke,x).call(o.fill,y).call(s.dashLine,T?"solid":_,T?4+b:b);if(p(A,t,a),w){var k=l(t.layout,"selections",a);A.style({cursor:"move"});var L={element:A.node(),plotinfo:d,gd:t,editHelpers:k,isActiveSelection:!0},S=n(u,t);i(S,A,L)}else A.style("pointer-events",T?"all":"none");M[T]=A}var E=M[0];M[1].node().addEventListener("click",(function(){return function(t,e){if(h(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void v(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=v,f(t)}}}(t,E)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function v(t){h(t)&&t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t))}t.exports={draw:f,drawOne:d,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=v,f(t)}}}},4200:function(t,e,r){"use strict";var n=r(8192).u,i=r(2880).extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},1004:function(t){"use strict";t.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},5968:function(t,e,r){"use strict";var n=r(2760).selectMode,i=r(1936).clearOutline,a=r(9856),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;t.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),u=e.gd,c=u._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,d=f.yaxis,p=e.isActiveSelection,v=e.dragmode,g=(u.layout||{}).selections||[];if(!n(v)&&void 0!==p){var m=u._fullLayout._activeSelectionIndex;if(m-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(m)){W(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(h=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=d(r),l=v(r);if(s||l){var u,c,f=o.selectAll(".select-outline-"+n.id);f&&i._fullLayout._outlining&&(s&&(u=M(f,t)),u&&a.call("_guiRelayout",i,{shapes:u}),l&&!U(t)&&(c=T(f,t)),c&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:c}).then((function(){e&&A(i)}))),i._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function X(t){return t._id}function Z(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(X),u=r.map(X);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,dt=et[0].yref;if(nt&&dt){var pt=ut(et);ct([O(t,nt,"x"),O(t,dt,"y")])($,pt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),h._reselect=!1}if(!a&&h._deselect){var vt=h._deselect;(function(t,e,r){for(var n=0;n=0)T._fullLayout._deactivateShape(T);else if(!x){var r=A.clickmode;E.done(kt).then((function(){if(E.clear(kt),2===t){for(bt.remove(),K=0;K-1&&H(e,T,n.xaxes,n.yaxes,n.subplot,n,bt),"event"===r&&ft(T,void 0);l.click(T,e,C.id)})).catch(k.error)}},n.doneFn=function(){Tt.remove(),E.done(kt).then((function(){E.clear(kt),!L&&J&&n.selectionDefs&&(J.subtract=xt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,X)),(L||x)&&q(n,L),n.doneFnCompleted&&n.doneFnCompleted(Lt),b&&ft(T,at)})).catch(k.error)}},clearOutline:x,clearSelectionsCache:q,selectOnClick:H}},6056:function(t,e,r){"use strict";var n=r(3916),i=r(5376),a=r(2904).line,o=r(8192).u,s=r(2880).extendFlat,l=r(1780).templatedArray,u=(r(6208),r(5464)),c=r(1776).ye,f=r(7728);t.exports=l("shape",{visible:s({},u.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:s({},u.legend,{editType:"calc+arraydraw"}),legendgroup:s({},u.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:s({},u.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:i({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:s({},u.legendrank,{editType:"calc+arraydraw"}),legendwidth:s({},u.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:s({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:s({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:s({},a.color,{editType:"arraydraw"}),width:s({},a.width,{editType:"calc+arraydraw"}),dash:s({},o,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:c({},{keys:Object.keys(f)}),font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})},6084:function(t,e,r){"use strict";var n=r(3400),i=r(4460),a=r(3068),o=r(5152);function s(t){return u(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return u(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function u(t,e,r,i,s,l){var u=t/2,c=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,f),d=n.aggNums(Math.min,null,f),p=d<0?Math.abs(d)+u:u,v=h>0?h+u:u;return{ppad:u,ppadplus:c?p:v,ppadminus:c?v:p}}return{ppad:u}}function c(t,e,r){var n,i,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,u=0,c=0,f=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],i=e[s+"1"],l&&(u=e[s+"0shift"],c=e[s+"1shift"])):(n=e[s+"anchor"],i=e[s+"anchor"]),void 0!==n)return[f(n)+u,f(i)+c];if(e.path){var h,d,p,v,g=1/0,m=-1/0,y=e.path.match(a.segmentRE);for("date"===t.type&&(f=o.decodeDate(f)),h=0;hm&&(m=v)));return m>=g?[g,m]:void 0}}t.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,_,b,w):0),A.call((function(e){return e.call(o.font,T).attr({}),a.convertToTspans(e,t),e}));var G=function(t,e,r,n,i,a,o){var s,l,u,c,h=i.label.textposition,d=i.label.textangle,p=i.label.padding,v=i.type,g=Math.PI/180*a,m=Math.sin(g),y=Math.cos(g),x=i.label.xanchor,b=i.label.yanchor;if("line"===v){"start"===h?(s=t,l=e):"end"===h?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===x&&(x="start"===h?"auto"===d?r>t?"left":rt?"right":rt?"right":rt?"left":r1&&(2!==t.length||"Z"!==t[1][0])&&(0===O&&(t[0][0]="M"),e[E]=t,A(),k())}}()}}function H(t,r){!function(t,r){if(e.length)for(var n=0;n_?(k=d,O="y0",L=_,C="y1"):(k=_,O="y1",L=d,C="y0"),it(n),st(l,r),function(t,e,r){var n=e.xref,i=e.yref,a=o.getFromId(r,n),s=o.getFromId(r,i),l="";"paper"===n||a.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),h.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),nt.moveFn="move"===I?at:ot,nt.altKey=n.altKey)},doneFn:function(){b(t)||(v(e),lt(l),M(e,t,r),i.call("_guiRelayout",t,c.getUpdateObj()))},clickFn:function(){b(t)||lt(l)}};function it(r){if(b(t))I=null;else if(j)I="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=nt.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!U&&i>z&&a>F&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";v(e,l),I=l.split("-")[0]}}function at(n,i){if("path"===r.type){var a=function(t){return t},o=a,c=a;N?H("xanchor",r.xanchor=tt(w+n)):(o=function(t){return tt(Q(t)+n)},Y&&"date"===Y.type&&(o=m.encodeDate(o))),B?H("yanchor",r.yanchor=et(A+i)):(c=function(t){return et($(t)+i)},W&&"date"===W.type&&(c=m.encodeDate(c))),H("path",r.path=T(P,o,c))}else N?H("xanchor",r.xanchor=tt(w+n)):(H("x0",r.x0=tt(f+n)),H("x1",r.x1=tt(x+n))),B?H("yanchor",r.yanchor=et(A+i)):(H("y0",r.y0=et(d+i)),H("y1",r.y1=et(_+i)));e.attr("d",y(t,r)),st(l,r),u(t,s,r,V)}function ot(n,i){if(U){var a=function(t){return t},o=a,c=a;N?H("xanchor",r.xanchor=tt(w+n)):(o=function(t){return tt(Q(t)+n)},Y&&"date"===Y.type&&(o=m.encodeDate(o))),B?H("yanchor",r.yanchor=et(A+i)):(c=function(t){return et($(t)+i)},W&&"date"===W.type&&(c=m.encodeDate(c))),H("path",r.path=T(P,o,c))}else if(j){if("resize-over-start-point"===I){var h=f+n,p=B?d-i:d+i;H("x0",r.x0=N?h:tt(h)),H("y0",r.y0=B?p:et(p))}else if("resize-over-end-point"===I){var v=x+n,g=B?_-i:_+i;H("x1",r.x1=N?v:tt(v)),H("y1",r.y1=B?g:et(g))}}else{var b=function(t){return-1!==I.indexOf(t)},M=b("n"),G=b("s"),q=b("w"),X=b("e"),Z=M?k+i:k,J=G?L+i:L,K=q?S+n:S,rt=X?E+n:E;B&&(M&&(Z=k-i),G&&(J=L-i)),(!B&&J-Z>F||B&&Z-J>F)&&(H(O,r[O]=B?Z:et(Z)),H(C,r[C]=B?J:et(J))),rt-K>z&&(H(R,r[R]=N?K:tt(K)),H(D,r[D]=N?rt:tt(rt)))}e.attr("d",y(t,r)),st(l,r),u(t,s,r,V)}function st(t,e){(N||B)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=Q(N?e.xanchor:a.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,g.paramIsX))),o=$(B?e.yanchor:a.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,g.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),N&&B){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(N){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function lt(t){t.selectAll(".visual-cue").remove()}p.init(nt),rt.node().onmousemove=it}(t,F,c,e,r,I):!0===c.editable&&F.style("pointer-events",D||f.opacity(E)*S<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(t,e){if(_(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,x(t)}}}(t,F)}))}c._input&&!0===c.visible&&("above"===c.layer?k(t._fullLayout._shapeUpperLayer):"paper"===c.xref||"paper"===c.yref?k(t._fullLayout._shapeLowerLayer):"between"===c.layer?k(w.shapelayerBetween):w._hadPlotinfo?k((w.mainplotinfo||w).shapelayer):k(t._fullLayout._shapeLowerLayer))}function M(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function T(t,e,r){return t.replace(g.segmentRE,(function(t){var n=0,i=t.charAt(0),a=g.paramIsX[i],o=g.paramIsY[i],s=g.numParams[i];return i+t.substr(1).replace(g.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){_(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,x(t))}t.exports={draw:x,drawOne:w,eraseActiveShape:function(t){if(_(t)){c(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&ld&&(t="X"),t}));return a>d&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),c+p}))}(r,l,c);if("pixel"===r.xsizemode){var A=l(r.xanchor);f=A+r.x0+_,h=A+r.x1+w}else f=l(r.x0)+_,h=l(r.x1)+w;if("pixel"===r.ysizemode){var k=c(r.yanchor);d=k-r.y0+M,p=k-r.y1+T}else d=c(r.y0)+M,p=c(r.y1)+T;if("line"===v)return"M"+f+","+d+"L"+h+","+p;if("rect"===v)return"M"+f+","+d+"H"+h+"V"+p+"H"+f+"Z";var L=(f+h)/2,S=(d+p)/2,E=Math.abs(L-f),O=Math.abs(S-d),C="A"+E+","+O,R=L+E+","+S;return"M"+R+C+" 0 1,1 "+L+","+(S-O)+C+" 0 0,1 "+R+"Z"}},1592:function(t,e,r){"use strict";var n=r(4016);t.exports={moduleType:"component",name:"shapes",layoutAttributes:r(6056),supplyLayoutDefaults:r(3712),supplyDrawNewShapeDefaults:r(5144),includeBasePlot:r(6632)("shapes"),calcAutorange:r(6084),draw:n.draw,drawOne:n.drawOne}},7728:function(t){"use strict";function e(t,e){return e?e.d2l(t):t}function r(t,e){return e?e.l2d(t):t}function n(t){return t.x0shift||0}function i(t){return t.x1shift||0}function a(t){return t.y0shift||0}function o(t){return t.y1shift||0}function s(t,r){return e(t.x1,r)+i(t)-e(t.x0,r)-n(t)}function l(t,r,n){return e(t.y1,n)+o(t)-e(t.y0,n)-a(t)}t.exports={x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},slope:function(t,e,r){return"line"!==t.type?void 0:l(t,0,r)/s(t,e)},dx:s,dy:l,width:function(t,e){return Math.abs(s(t,e))},height:function(t,e,r){return Math.abs(l(t,0,r))},length:function(t,e,r){return"line"!==t.type?void 0:Math.sqrt(Math.pow(s(t,e),2)+Math.pow(l(t,0,r),2))},xcenter:function(t,a){return r((e(t.x1,a)+i(t)+e(t.x0,a)+n(t))/2,a)},ycenter:function(t,n,i){return r((e(t.y1,i)+o(t)+e(t.y0,i)+a(t))/2,i)}}},9861:function(t,e,r){"use strict";var n=r(5376),i=r(6741),a=r(2880).extendDeepAll,o=r(7824).overrideAll,s=r(5656),l=r(1780).templatedArray,u=r(876),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},876:function(t){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},8132:function(t,e,r){"use strict";var n=r(3400),i=r(1272),a=r(9861),o=r(876).name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:u}),l=0,c=0;c0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(t){var e=t._context.staticPlot,r=t._fullLayout,a=function(t,e){for(var r=t[f.name],n=[],i=0;i0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(s.enter().append("g").classed(f.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==a.length){var u=s.selectAll("g."+f.groupClassName).data(a,m);u.enter().append("g").classed(f.groupClassName,!0),u.exit().each(l).remove();for(var c=0;c0||M<0){var S={left:[-T,0],right:[T,0],top:[0,-T],bottom:[0,T]}[_.side];a.attr("transform",l(S[0],S[1]))}}}function ht(t,e){t.text(e).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(at.call(ut,ot),et&&(L?at.on(".opacity",null):(ht(at,x),S=!0),at.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,y,e,b):o.call("_guiRelayout",t,y,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ut)})).on("input",(function(t){this.text(t||" ").call(f.positionText,w.x,w.y)})),B)){if(B&&!L){var dt=at.node().getBBox(),pt=dt.y+dt.height+1.6*q;ot.attr("y",pt)}H?ot.on(".opacity",null):(ht(ot,j),V=!0),ot.call(f.makeEditable,{gd:t}).on("edit",(function(e){o.call("_guiRelayout",t,"title.subtitle.text",e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ut)})).on("input",(function(t){this.text(t||" ").call(f.positionText,ot.attr("x"),ot.attr("y"))}))}return at.classed("js-placeholder",S),ot&&ot.classed("js-placeholder",V),T},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}},8444:function(t,e,r){"use strict";var n=r(5376),i=r(2548),a=r(2880).extendFlat,o=r(7824).overrideAll,s=r(6741),l=r(1780).templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},1331:function(t){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},1384:function(t,e,r){"use strict";var n=r(3400),i=r(1272),a=r(8444),o=r(1331).name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},4420:function(t,e,r){"use strict";var n=r(3428),i=r(7316),a=r(6308),o=r(3616),s=r(3400),l=r(2736),u=r(1780).arrayEditor,c=r(4284).LINE_SPACING,f=r(1331),h=r(7400);function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function v(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||m(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,u=i.active,c=i.buttons[u]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,c,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(L,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(M,i)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,g=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+p+o.pad.l,y:m.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(k,o,b),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(v(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(v(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(M,o),c.call(_,o)}))})),c.call(_,o),x?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,d=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,A=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,L=p,S=g+m;S+k>u&&(S=u-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),T?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:L,y:S,width:A,height:k}),this._hbarXMin=L+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>M,C=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,D=p+v,P=g;D+C>l&&(D=l-C);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),O?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:P,width:C,height:R}),this._vbarYMin=P+R/2,this._vbarTranslateMax=M-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,F=c-.5,N=O?f+C+.5:f+.5,B=h-.5,j=T?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+z).data(T||O?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",z).append("rect"),T||O?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(j)-Math.floor(B)}),this.container.call(a.setClipUrl,z,this.gd),this.bg.attr({x:p,y:g,width:v,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),T||O){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},4284:function(t){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},6208:function(t){"use strict";t.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},6880:function(t){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},9104:function(t){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},9168:function(t){"use strict";t.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},5412:function(t){"use strict";t.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},3448:function(t){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},9032:function(t){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}},9616:function(t,e){"use strict";e.xmlns="http://www.w3.org/2000/xmlns/",e.svg="http://www.w3.org/2000/svg",e.xlink="http://www.w3.org/1999/xlink",e.svgAttrs={xmlns:e.svg,"xmlns:xlink":e.xlink}},4884:function(t,e,r){"use strict";e.version=r(5788).version,r(8324),r(9288);for(var n=r(4040),i=e.register=n.register,a=r(2448),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},8308:function(t,e){"use strict";e.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},e.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},e.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},e.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},e.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},e.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},1864:function(t,e,r){"use strict";var n=r(435),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,f,h,d,p,v=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}v?(c=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},8116:function(t,e,r){"use strict";var n=r(3160).decode,i=r(3620),a=Array.isArray,o=ArrayBuffer,s=DataView;function l(t){return o.isView(t)&&!(t instanceof s)}function u(t){return a(t)||l(t)}e.isTypedArray=l,e.isArrayOrTypedArray=u,e.isArray1D=function(t){return!u(t[0])},e.ensureArray=function(t,e){return a(t)||(t=[]),t.length=e,t};var c={u1c:"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"==typeof Int8Array?void 0:Int8Array,u1:"undefined"==typeof Uint8Array?void 0:Uint8Array,i2:"undefined"==typeof Int16Array?void 0:Int16Array,u2:"undefined"==typeof Uint16Array?void 0:Uint16Array,i4:"undefined"==typeof Int32Array?void 0:Int32Array,u4:"undefined"==typeof Uint32Array?void 0:Uint32Array,f4:"undefined"==typeof Float32Array?void 0:Float32Array,f8:"undefined"==typeof Float64Array?void 0:Float64Array};function f(t){return t.constructor===ArrayBuffer}function h(t,e,r){if(u(t)){if(u(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){-1===(i.extras||[]).indexOf(t)?(p(t)&&(t=v(t)),t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)):e.set(t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){p(t)&&(t=v(t)),i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(s.get(t,r))}},angle:{coerceFunction:function(t,e,r){p(t)&&(t=v(t)),"auto"===t?e.set("auto"):n(t)?e.set(h(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||f(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!f(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(r),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),r="");var w=u&&"chinese"===r.substr(0,7),M=t.match(w?x:y);if(!M)return c;var T=M[1],A=M[3]||"1",k=Number(M[5]||1),L=Number(M[7]||0),S=Number(M[9]||0),E=Number(M[11]||0);if(u){if(2===T.length)return c;var O;T=Number(T);try{var C=g.getComponentMethod("calendars","getCal")(r);if(w){var R="i"===A.charAt(A.length-1);A=parseInt(A,10),O=C.newDate(T,C.toMonthIndex(T,A,R),k)}else O=C.newDate(T,Number(A),k)}catch(t){return c}return O?(O.toJD()-v)*f+L*h+S*d+E*p:c}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),A-=1;var D=new Date(Date.UTC(2e3,A,k,L,S));return D.setUTCFullYear(T),D.getUTCMonth()!==A||D.getUTCDate()!==k?c:D.getTime()+E*p},n=e.MIN_MS=e.dateTime2ms("-9999"),i=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==c};var M=90*f,T=3*h,A=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}e.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var L=Math.floor(w/f)+v,S=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},e.cleanDate=function(t,r,n){if(t===c)return r;if(e.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,n))return s.error("unrecognized date",t),r;return t};var L=/%\d?f/g,S=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function O(t,e,r,n){t=t.replace(L,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(S,(function(){return E[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var C=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),C[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+O(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return O(e,t,n,i)};var R=3*f;e.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+v,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-v)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+R);return u.setUTCMonth(u.getUTCMonth()+e)+n-R},e.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&g.getComponentMethod("calendars","getCal")(e),c=0;c1||v<0||v>1?null:{x:t+l*v,y:e+f*v}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}e.segmentsIntersect=s,e.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,d=u-a,p=c*c+f*f,v=h*h+d*d,g=Math.min(l(c,f,p,i-t,a-e),l(c,f,p,o-t,u-e),l(h,d,v,t-i,e-a),l(h,d,v,r-i,n-a));return Math.sqrt(g)},e.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},e.clearLocationCache=function(){i=null},e.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},3040:function(t,e,r){"use strict";var n=r(8248),i=r(9760),a=r(2160),o=r(8932),s=r(2548).defaultLine,l=r(8116).isArrayOrTypedArray,u=a(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=a(t);return e.length?e:u}function h(t){return n(t)?t:1}t.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var i,s,d,p,v,g=l(n),m=l(e),y=o.extractOpts(t),x=[];if(i=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,s=g?function(t,e){return void 0===t[e]?u:a(i(t[e]))}:f,d=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||m)for(var b=0;b1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},3400:function(t,e,r){"use strict";var n=r(3428),i=r(4336).E9,a=r(7624).E9,o=r(8248),s=r(9032),l=s.FP_SAFE,u=-l,c=s.BADNUM,f=t.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=r(2296),f.keyedContainer=r(7804),f.relativeAttr=r(3193),f.isPlainObject=r(3620),f.toLogRange=r(6896),f.relinkPrivateKeys=r(1528);var d=r(8116);f.isArrayBuffer=d.isArrayBuffer,f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=r(435);f.mod=p.mod,f.modHalf=p.modHalf;var v=r(3064);f.valObjectMeta=v.valObjectMeta,f.coerce=v.coerce,f.coerce2=v.coerce2,f.coerceFont=v.coerceFont,f.coercePattern=v.coercePattern,f.coerceHoverinfo=v.coerceHoverinfo,f.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,f.validate=v.validate;var g=r(7555);f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var m=r(4952);f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=r(2996);var y=r(3084);f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.geometricMean=y.geometricMean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=r(2248);f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=r(1864);f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=r(8308);f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=r(2348);f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=r(2880);f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var T=r(4248);f.log=T.log,f.warn=T.warn,f.error=T.error;var A=r(3756);f.counterRegex=A.counter;var k=r(1200);f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var L=r(2200);function S(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&o(t)&&t>=0&&t%1==0},f.noop=r(6628),f.identity=r(5536),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return I.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var z={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return U.apply(z,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return U.apply(F,arguments)};var N=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,B={max:10,count:0,name:"texttemplate",parseMultDiv:!0};f.texttemplateStringForShapes=function(){return U.apply(B,arguments)};var j=/^[:|\|]/;function U(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var u="_xother"===s||"_yother"===s,c="_xother_"===s||"_yother_"===s,h="xother_"===s||"yother_"===s,d="xother"===s||"yother"===s||u||h||c,p=s;(u||c)&&(p=p.substring(1)),(h||c)&&(p=p.substring(0,p.length-1));var v,g,m,y=null,x=null;if(n.parseMultDiv){var b=function(t){var e=t.match(N);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(p);p=b.key,y=b.op,x=b.number}if(d){if(void 0===(v=e[p]))return""}else for(m=3;m=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var H=2e9;f.seedPseudoRandom=function(){H=2e9},f.pseudoRandom=function(){var t=H;return H=(69069*H+1)%4294967296,Math.abs(H-t)<429496729?f.pseudoRandom():H/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(u=1):u=0,f.strTranslate(i-u*(r+o),a-u*(n+s))+f.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},f.bigFont=function(t){return Math.round(1.2*t)};var V=f.getFirefoxVersion(),Y=null!==V&&V<86;f.getPositionFromD3Event=function(){return Y?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},3620:function(t){"use strict";t.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}},7804:function(t,e,r){"use strict";var n=r(2296),i=/^\w*$/;t.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},988:function(t,e,r){"use strict";var n=r(3428);t.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},2248:function(t,e,r){"use strict";var n=r(6524);e.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},2296:function(t,e,r){"use strict";var n=r(8248),i=r(8116).isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;la||u===i||us||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,f,h,d,p,v=r.length,g=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,g)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}},4296:function(t,e,r){"use strict";var n=r(8248),i=r(5928);t.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;return"undefined"!=typeof navigator&&(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),t}()))return!0;var r=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}return r}},2416:function(t){"use strict";t.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function f(t,e){return t>=e}e.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-s)-1:Math.floor((t-e.start)/e.size+s);var a,o,h=0,d=e.length,p=0,v=d>1?(e[d-1]-e[0])/(d-1):1;for(o=v>=0?r?l:u:r?f:c,t+=v*s*(r?-1:1)*(v>=0?1:-1);h90&&i.log("Long binary search..."),h-1},e.sorterAsc=function(t,e){return t-e},e.sorterDes=function(t,e){return e-t},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===o;r--);for(var i,a=n[r]-n[0]||1,s=a/(r||1)/1e4,l=[],u=0;u<=r;u++){var c=n[u],f=c-i;void 0===i?(l.push(c),i=c):f>s&&(a=Math.min(a,f),l.push(c),i=c)}return{vals:l,minDiff:a}},e.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},e.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(r)||(r=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},696:function(t,e,r){"use strict";var n=r(2160);t.exports=function(t){return t?n(t):[0,0,0,1]}},2736:function(t,e,r){"use strict";var n=r(3428),i=r(3400),a=i.strTranslate,o=r(9616),s=r(4284).LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;e.convertToTspans=function(t,r,g){var L=t.text(),S=!t.attr("data-notex")&&r&&r._context.typesetMath&&"undefined"!=typeof MathJax&&L.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var R=t.attr("class")?t.attr("class").split(" ")[0]:"text";return R+="-math",C.selectAll("svg."+R).remove(),C.selectAll("g."+R+"-group").remove(),t.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),S?(r&&r._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var a,o,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2===h||3===h){var d=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(a):MathJax.typeset([a])},p=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),d,p,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){d(),p(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}else i.warn("No MathJax version:",MathJax.version)}(S[2],o,(function(n,i,o){C.selectAll("svg."+R).remove(),C.selectAll("g."+R+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return D(),void e();var l=C.append("g").classed(R+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var u=o.width,c=o.height;s.attr({class:R,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",h=s.select("g");h.attr({fill:f,stroke:f});var d=h.node().getBoundingClientRect(),p=d.width,v=d.height;(p>u||v>c)&&(s.style("overflow","hidden"),p=(d=s.node().getBoundingClientRect()).width,v=d.height);var m=+t.attr("x"),y=+t.attr("y"),x=-(r||t.node().getBoundingClientRect().height)/4;if("y"===R[0])l.attr({transform:"rotate("+[-90,m,y]+")"+a(-p/2,x-v/2)});else if("l"===R[0])y=x-v/2;else if("a"===R[0]&&0!==R.indexOf("atitle"))m=0,y=x;else{var b=t.attr("text-anchor");m-=p*("middle"===b?.5:"end"===b?1:0),y=y+x-v/2}s.attr({x:m,y:y}),g&&g.call(t,l),e(l)}))}))):D(),t}function D(){C.empty()||(R=t.attr("class")+"-math",C.select("svg."+R).remove()),t.text("").style("white-space","pre");var r=function(t,e){e=e.replace(m," ");var r,a=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var S=e.split(y),C=0;C|>|>)/g,f=[["$","$"],["\\(","\\)"]],h={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},v="​",g=["http:","https:","mailto:","",void 0,":"],m=e.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,x=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;e.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,w=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var k=/(^|;)\s*color:/;e.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(y),a=[],o="",s=0,l=0;l3?a.push(u.substr(0,d-3)+"..."):a.push(u.substr(0,d));break}o=""}}return a.join("")};var L={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):L[e])||t}))}function O(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==g.indexOf(i)&&-1!==g.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=a()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}e.convertEntities=E,e.sanitizeHTML=function(t){t=t.replace(m," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(y),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},e.done=function(t){var e=r[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},e.clear=function(t){if(t)n(r[t]),delete r[t];else for(var i in r)e.clear(i)}},6896:function(t,e,r){"use strict";var n=r(8248);t.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},1680:function(t){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},6580:function(t){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},9820:function(t,e,r){"use strict";var n=r(4040);t.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},e.cleanLayout=function(t){var r,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(t);for(r=0;r3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var r=0;r0)return t.substr(0,e)}e.hasParent=function(t,e){for(var r=b(e);r;){if(r in t)return!0;r=b(r)}return!1};var _=["x","y","z"];e.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!v&&(h(g,m),d(t),!0)}var x,b,_,w,M,T,A,k,L=Object.keys(r).map(Number).sort(o),S=e.get(),E=S||[],O=c(m,f).get(),C=[],R=-1,D=E.length;for(x=0;xE.length-(A?0:1))a.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?C.push(_):A?("add"===T&&(T={}),E.splice(_,0,T),O&&O.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,T),-1===R&&(R=_);else for(b=0;b=0;x--)E.splice(C[x],1),O&&O.splice(C[x],1);if(E.length?S||e.set(E):e.set(null),v)return!1;if(h(g,m),p!==i){var P;if(-1===R)P=L;else{for(D=Math.max(E.length,D),P=[],x=0;x=R);x++)P.push(_);for(x=R;x=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),D(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in D(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=R(r,t.data.length-1),e)for(var v=0;v-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){t=o.getGraphDiv(t),M.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Z(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(T.layoutReplot):Object.keys(n).length&&(Y(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(T.doLegend),a.layoutstyle&&s.push(T.layoutStyles),a.axrange&&G(s,i.rangesAltered),a.ticks&&s.push(T.doTicksRelayout),a.modebar&&s.push(T.doModeBar),a.camera&&s.push(T.doCamera),a.colorbars&&s.push(T.doColorBars),s.push(S)),s.push(h.rehover,h.redrag,h.reselect),u.add(t,V,[t,i.undoit],V,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function Y(t,e,r){var n,i,a=t._fullLayout;if(!e.axrange)return!1;for(var s in e)if("axrange"!==s&&e[s])return!1;var l=function(t,e){return o.coerce(n,i,v,t,e)},u={};for(var c in r.rangesAltered){var f=d.id2name(c);if(n=t.layout[f],i=a[f],p(n,i,l,u),i._matchGroup)for(var h in i._matchGroup)if(h!==c){var g=a[d.id2name(h)];g.autorange=i.autorange,g.range=i.range.slice(),g._input.range=i.range.slice()}}return!0}function G(t,e){var r=e?function(t){var r=[];for(var n in e){var i=d.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return d.draw(t,r,{skipTitle:!0})}:function(t){return d.draw(t,"redraw")};t.push(b,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var W=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=B(l._preGUI,u),p=Object.keys(e),v=d.list(t),g=o.extendDeepAll({},e),m={};for(H(e),p=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[I];)I--;var z=D.parts[I],F=D.parts[I-1]+"."+z,j=D.parts.slice(0,I).join("."),U=s(t.layout,j).get(),V=s(l,j).get(),Y=D.get();if(void 0!==P){T[R]=P,L[R]="reverse"===z?P:N(Y);var G=f.getLayoutValObject(l,D.parts);if(G&&G.impliedEdits&&null!==P)for(var Z in G.impliedEdits)S(o.relativeAttr(R,Z),G.impliedEdits[Z]);if(-1!==["width","height"].indexOf(R))if(P){S("autosize",null);var K="height"===R?"width":"height";S(K,l[K])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)S("width",P?null:l.width),S("height",P?null:l.height);else if(F.match(W))C(F),s(l,j+"._inputRange").set(null);else if(F.match(q)){C(F),s(l,j+"._inputRange").set(null);var Q=s(l,j).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(X)&&s(l,j+"._inputDomain").set(null);if("type"===z){E=U;var $="linear"===V.type&&"log"===P,tt="log"===V.type&&"linear"===P;if($||tt){if(E&&E.range)if(V.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&S(j+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(j+".range[0]",Math.log(et)/Math.LN10),S(j+".range[1]",Math.log(rt)/Math.LN10)):(S(j+".range[0]",Math.pow(10,et)),S(j+".range[1]",Math.pow(10,rt)))}else S(j+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,V,P,S),c.getComponentMethod("images","convertCoords")(t,V,P,S)}else S(j+".autorange",!0),S(j+".range",null);s(l,j+"._inputRange").set(null)}else if(z.match(k)){var nt=s(l,R).get(),it=(P||{}).type;it&&"-"!==it||(it="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,it,S),c.getComponentMethod("images","convertCoords")(t,nt,it,S)}var at=w.containerArrayMatch(R);if(at){r=at.array,n=at.index;var ot=at.property,st=G||{editType:"calc"};""!==n&&""===ot&&(w.isAddVal(P)?L[R]=null:w.isRemoveVal(P)?L[R]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(_,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=P,delete e[R]}else"reverse"===z?(U.range?U.range.reverse():(S(j+".autorange",!0),U.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):("dragmode"===R&&(!1===P&&!1!==Y||!1!==P&&!1===Y)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===P||"select"===P)&&"lasso"!==Y&&"select"!==Y||l._has("gl2d")?_.plot=!0:G?A.update(_,G):_.calc=!0,D.set(P))}}for(r in m)w.applyContainerArrayChanges(t,h(a,r),m[r],_,h)||(_.plot=!0);for(var ut in O){var ct=(E=d.getFromId(t,ut))&&E._constraintGroup;if(ct)for(var ft in _.calc=!0,ct)O[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}(J(t)||e.height||e.width)&&(_.plot=!0);var ht=l.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,M.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}var d,p,v=0;function g(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var m=[],y=null==e,x=Array.isArray(e);if(y||x||!o.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&ww)&&T.push(p);m=T}}m.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var v=e[n].name,g=(c[v]||p[v]||{}).name,m=e[n].name,y=c[g]||p[g];g&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(c[g]||p[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[v]={name:v},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,a];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,a)},e.addTraces=function t(r,n,i){r=o.getGraphDiv(r);var a,s,l=[],c=e.deleteTraces,f=t,h=[r,l],d=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||a.type.dflt]||{})._module),!c)return!1;if(!(i=(r=c.attributes)&&r[o])){var f=c.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return b(i,e,s)},e.getLayoutValObject=function(t,e){var r=function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,u=e+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][a]=s)}function f(t,e){s?n.nestedProperty(l[u],t).set(e):l[u+"."+t]=e}function h(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:f,getUpdateObj:h,applyUpdate:function(e,r){e&&f(e,r);var i=h();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},9172:function(t,e,r){"use strict";var n=r(3428),i=r(4040),a=r(7316),o=r(3400),s=r(2736),l=r(3696),u=r(6308),c=r(3616),f=r(1668),h=r(3080),d=r(4460),p=r(4284),v=r(1888),g=v.enforce,m=v.clean,y=r(9280).doAutoRange,x="start",b=r(3816).zindexSeparator;function _(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function w(t){var r,i,s,l,f,v,g=t._fullLayout,m=g._size,y=m.p,x=d.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),e.drawMainTitle(t),h.manage(t),!g._has("cartesian"))return a.previousPromises(t);function w(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-y-n:e._offset+e._length+y+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+y+n:e._offset-y-n:m.l+m.w*(t.position||0)+n%1}for(r=0;r.5?"t":"b",o=t._fullLayout.margin[a],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===t?("top"===r&&(a+=i),a+=n-e*n):("bottom"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,e,v);if(g>0){!function(t,e,r,n){var i="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",u={x:s.x,y:s.y,t:0,b:0},c={};"paper"===s.yref&&function(t,e,r,n,i){var a="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=o.isTopAnchor(e)?n:n-i,l="b"===r?a-s:s;return!(o.isTopAnchor(e)&&"t"===r||o.isBottomAnchor(e)&&"b"===r)&&lM?c.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=v(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:d,layout:h},""),c.length)return c.map(m)}},7024:function(t,e,r){"use strict";var n=r(8248),i=r(6424),a=r(7316),o=r(3400),s=r(7030),l=r(7164),u=r(3268),c=r(5788).version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(t,e){var r,h,d,p;function v(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!v("width")&&null!==e.width||!v("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!v("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function m(t,r){return o.coerce(e,g,f,t,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var A=o.extendFlat({},h);x?A.width=x:null===e.width&&n(p.width)&&(A.width=p.width),b?A.height=b:null===e.height&&n(p.height)&&(A.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function h(){i.purge(T),document.body.removeChild(T)}if("full-json"===y){var d=a.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),h(),t(M?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(M?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(T,r,A,k).then(L).then(S).then(E).then((function(e){t(function(t){return M?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},1480:function(t,e,r){"use strict";var n=r(3400),i=r(7316),a=r(3060),o=r(556).dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(d("unused",a,m.concat(x.length)));var A,k,L,S,E,O=x.length,C=Array.isArray(T);if(C&&(O=Math.min(O,T.length)),2===b.dimensions)for(k=0;kx[k].length&&i.push(d("unused",a,m.concat(k,x[k].length)));var R=x[k].length;for(A=0;A<(C?Math.min(R,T[k].length):R);A++)L=C?T[k][A]:T,S=y[k][A],E=x[k][A],n.validate(S,L)?E!==S&&E!==+S&&i.push(d("dynamic",a,m.concat(k,A),S,E)):i.push(d("value",a,m.concat(k,A),S))}else i.push(d("array",a,m.concat(k),y[k]));else for(k=0;k1&&h.push(d("object","layout"))),i.supplyDefaults(p);for(var v=p._fullData,g=r.length,m=0;m0&&Math.round(f)===f))return{vals:i};u=f}for(var h=e.calendar,d="start"===l,p="end"===l,v=t[r+"period0"],g=a(v,h)||0,m=[],y=[],x=[],b=i.length,_=0;_A;)T=o(T,-u,h);for(;T<=A;)T=o(T,u,h);M=o(T,-u,h)}else{for(T=g+(w=Math.round((A-g)/c))*c;T>A;)T-=c;for(;T<=A;)T+=c;M=T-c}m[_]=d?M:p?T:(M+T)/2,y[_]=M,x[_]=T}return{vals:m,starts:y,ends:x}}},6720:function(t){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},9280:function(t,e,r){"use strict";var n=r(3428),i=r(8248),a=r(3400),o=r(9032).FP_SAFE,s=r(4040),l=r(3616),u=r(9811),c=u.getFromId,f=u.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),u=g(t,e),c=u.min,f=u.max;if(0===c.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=c[0].val,v=f[0].val;for(r=1;r0&&((A=O-s(b)-l(_))>C?k/A>R&&(w=b,M=_,R=k/A):k/O>R&&(w={val:b.val,nopad:1},M={val:_.val,nopad:1},R=k/O));if(h===v){var D=h-1,P=h+1;if(S)if(0===h)i=[0,1];else{var I=(h>0?f:c).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,I/O));i=h>0?[0,z]:[z,0]}else i=E?[Math.max(0,D),Math.max(1,P)]:[D,P]}else S?(w.val>=0&&(w={val:0,nopad:1}),M.val<=0&&(M={val:0,nopad:1})):E&&(w.val-R*s(w)<0&&(w={val:0,nopad:1}),M.val<=0&&(M={val:1,nopad:1})),R=(M.val-w.val-d(e,b.val,_.val))/(O-s(w)-l(M)),i=[w.val-R*s(w),M.val+R*l(M)];return i=T(i,e),e.limitRange&&e.limitRange(),y&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),L=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=A(r.vpadplus||r.vpad),E=A(r.vpadminus||r.vpad);if(!M){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=a),a>d&&a-o&&(h=a),a>d&&a=R;n--)C(n);return{min:p,max:v,opts:r}},concatExtremes:g};var v=3;function g(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,u=[],f=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function b(t){return i(t)&&Math.abs(t)=e}function M(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))=u&&(o=u,r=u),s<=u&&(s=u,n=u)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&M(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&M(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&M(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&M(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}},6808:function(t){"use strict";t.exports=function(t,e,r){var n,i;if(r){var a="reversed"===e||"min reversed"===e||"max reversed"===e;n=r[a?1:0],i=r[a?0:1]}var o=t("autorangeoptions.minallowed",null===i?n:void 0),s=t("autorangeoptions.maxallowed",null===n?i:void 0);void 0===o&&t("autorangeoptions.clipmin"),void 0===s&&t("autorangeoptions.clipmax"),t("autorangeoptions.include")}},4460:function(t,e,r){"use strict";var n=r(3428),i=r(8248),a=r(7316),o=r(4040),s=r(3400),l=s.strTranslate,u=r(2736),c=r(1668),f=r(6308),h=r(3616),d=r(4724),p=r(8728),v=r(9032),g=v.ONEMAXYEAR,m=v.ONEAVGYEAR,y=v.ONEMINYEAR,x=v.ONEMAXQUARTER,b=v.ONEAVGQUARTER,_=v.ONEMINQUARTER,w=v.ONEMAXMONTH,M=v.ONEAVGMONTH,T=v.ONEMINMONTH,A=v.ONEWEEK,k=v.ONEDAY,L=k/2,S=v.ONEHOUR,E=v.ONEMIN,O=v.ONESEC,C=v.ONEMILLI,R=v.ONEMICROSEC,D=v.MINUS_SIGN,P=v.BADNUM,I={K:"zeroline"},z={K:"gridline",L:"path"},F={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},B={K:"tick",L:"text"},j={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},U=r(4284),H=U.MID_SHIFT,V=U.CAP_SHIFT,Y=U.LINE_SPACING,G=U.OPPOSITE_SIDE,W=t.exports={};W.setConvert=r(8344);var q=r(2976),X=r(9811),Z=X.idSort,J=X.isLinked;W.id2name=X.id2name,W.name2id=X.name2id,W.cleanId=X.cleanId,W.list=X.list,W.listIds=X.listIds,W.getFromId=X.getFromId,W.getFromTrace=X.getFromTrace;var K=r(9280);W.getAutoRange=K.getAutoRange,W.findExtremes=K.findExtremes;var Q=1e-4;function $(t){var e=(t[1]-t[0])*Q;return[t[0]-e,t[1]+e]}W.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,c,u)},W.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},W.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==W.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var u=W.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},W.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:W.getFromId(e,r).cleanPos)(t)},W.redrawComponents=function(t,e){e=e||W.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;cn&&h2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},W.saveRangeInitial=function(t,e){for(var r=W.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=W.tickIncrement(t,"M6","reverse")+1.5*k:a.exactMonths>.8?t=W.tickIncrement(t,"M1","reverse")+15.5*k:t-=L;var l=W.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,u,a)),g=y;g<=c;)g=W.tickIncrement(g,m,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(g,0,a),size:m,_dataSpan:c-u}},W.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=W.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,W.prepTicks(t,r),a){var u=i(e.dtick),c=i(t.dtick),f=u?e.dtick:+e.dtick.substring(1),h=c?t.dtick:+t.dtick.substring(1);u&&c?nt(f,h)?f===2*A&&h===2*k&&(t.dtick=A):f===2*A&&h===3*k?t.dtick=A:f!==A||(e._input.minor||{}).nticks?it(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=k:"M"===String(e.dtick).charAt(0)?c?t.dtick="M1":nt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?nt(f,h)||(t.dtick=it(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},W.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,W.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=W.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=S,o&&!n&&t.dtickt.range[1],d=!t.ticklabelindex||s.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],p=s.simpleMap(t.range,t.r2l,void 0,void 0,e),v=p[1]=(H?0:1);V--){var Y=!V;V?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var G=V?t:s.extendFlat({},t,t.minor);if(Y?W.prepMinorTicks(G,t,e):W.prepTicks(G,e),"array"!==G.tickmode)if("sync"!==G.tickmode){var q=$(p),X=q[0],Z=q[1],J=i(G.dtick),K="log"===l&&!(J||"L"===G.dtick.charAt(0)),Q=W.tickFirst(G,e);if(V){if(t._tmin=Q,Q=Z:nt<=Z;nt=W.tickIncrement(nt,it,v,u)){if(V&&tt++,G.rangebreaks&&!v){if(nt=I)break}if(B.length>z||nt===rt)break;rt=nt;var at={value:nt};V?(K&&nt!==(0|nt)&&(at.simpleLabel=!0),c>1&&tt%c&&(at.skipLabel=!0),B.push(at)):(at.minor=!0,j.push(at))}}else B=[],F=st(t);else V?(B=[],F=lt(t,!Y)):(j=[],N=lt(t,!Y))}!j||j.length<2?d=!1:(r=(j[1].value-j[0].value)*(h?-1:1),n=t.tickformat,(/%f/.test(n)?r>=R:/%L/.test(n)?r>=C:/%[SX]/.test(n)?r>=O:/%M/.test(n)?r>=E:/%[HI]/.test(n)?r>=S:/%p/.test(n)?r>=L:/%[Aadejuwx]/.test(n)?r>=k:/%[UVW]/.test(n)?r>=A:/%[Bbm]/.test(n)?r>=T:/%[q]/.test(n)?r>=_:!/%[Yy]/.test(n)||r>=y)||(d=!1));if(d){var ot=B.concat(j);f&&B.length&&(ot=ot.slice(1)),(ot=ot.sort((function(t,e){return t.value-e.value})).filter((function(t,e,r){return 0===e||t.value!==r[e-1].value}))).map((function(t,e){return void 0!==t.minor||t.skipLabel?null:e})).filter((function(t){return null!==t})).forEach((function(t){d.map((function(e){var r=t+e;r>=0&&r0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,u=t[o].value,c=Math.abs(u-l),f=r||c,h=0;f>=y?h=c>=y&&c<=g?c:m:r===b&&f>=_?h=c>=_&&c<=x?c:b:f>=T?h=c>=T&&c<=w?c:M:r===A&&f>=A?h=A:f>=k?h=k:r===L&&f>=L?h=L:r===S&&f>=S&&(h=S),h>=c&&(h=c,s=!0);var d=i+h;if(e.rangebreaks&&h>0){for(var p=0,v=0;v<84;v++){var E=(v+.5)/84;e.maskBreaks(i*(1-E)+E*d)!==P&&p++}(h*=p/84)||(t[n].drop=!0),s&&c>A&&(h=c)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(U,t,t._definedDelta),t.rangebreaks){var gt="y"===t._id.charAt(0),mt=1;"auto"===t.tickmode&&(mt=t.tickfont?t.tickfont.size:12);var yt=NaN;for(a=B.length-1;a>-1;a--)if(B[a].drop)B.splice(a,1);else{B[a].value=Ft(B[a].value,t);var xt=t.c2p(B[a].value);(gt?yt>xt-mt:ytI||nI&&(r.periodX=I),n10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&a<=10||e>=15*k)t._tickround="d";else if(e>=E&&a<=16||e>=S)t._tickround="M";else if(e>=O&&a<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(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),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(bt(t.exponentformat)&&!_t(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function yt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}W.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>m)e/=m,n=a(10),t.dtick="M"+12*gt(e,n,ut);else if(o>M)e/=M,t.dtick="M"+gt(e,1,ct);else if(o>k){if(t.dtick=gt(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:ht),!r){var l=W.getTickFormat(t),u="period"===t.ticklabelmode;u&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),u&&(t._dowTick0=t.tick0)}}else o>S?t.dtick=gt(e,S,ct):o>E?t.dtick=gt(e,E,ft):o>O?t.dtick=gt(e,O,ft):(n=a(10),t.dtick=gt(e,n,ut))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var f=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/f,n=a(10),t.dtick="L"+gt(e,n,ut)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):zt(t)?(t.tick0=0,n=1,t.dtick=gt(e,n,vt)):(t.tick0=0,n=a(10),t.dtick=gt(e,n,ut));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},W.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?pt:dt,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},W.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1]=0&&r<=t._length?e:null};if(l&&s.isArrayOrTypedArray(t.ticktext)){var d=s.simpleMap(t.range,t.r2l),p=(Math.abs(d[1]-d[0])-(t._lBreaks||0))/1e4;for(a=0;a ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);if("never"===a&&(a=""),n&&"L"!==c&&(o="L3",c="L"),u||"L"===c)e.text=wt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||bt(d)&&_t(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":D)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":D)+h:(e.text=wt(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("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*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):zt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=wt(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){for(var r=1;!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=wt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="π":e.text=o[0]+"π":e.text=["",o[0],"","⁄","",o[1],"","π"].join(""),l&&(e.text=D+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=wt(e.x,t,i,n)}(t,o,0,u,g),n||(t.tickprefix&&!v(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!v(t.showticksuffix)&&(o.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(o.text)){var m=t.labelalias[o.text];"string"==typeof m&&(o.text=m)}return("boundaries"===t.tickson||t.showdividers)&&(o.xbnd=[h(o.x-.5),h(o.x+t.dtick-.5)]),o},W.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=s.isArrayOrTypedArray(e)?e[0]:e,i=s.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return W.hoverLabelText(t,n,r)+" - "+W.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=W.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":D+o:o};var xt=["f","p","n","μ","m","","k","M","G","T"];function bt(t){return"SI"===t||"B"===t}function _t(t){return t>14||t<-15}function wt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=W.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};mt(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,D);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":bt(l)&&(t+=xt[u/3+5])),a?D+t:t}function Mt(t,e){if(t){var r=Object.keys(j).reduce((function(t,r){return-1!==e.indexOf(r)&&j[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function Tt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=c(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=o(i)))){r=n;break}break;case"log":for(e=0;e=0&&i.unshift(i.splice(n,1).shift())}}));var o={false:{left:0,right:0}};return s.syncOrAsync(i.map((function(e){return function(){if(e){var n=W.getFromId(t,e);r||(r={}),r.axShifts=o,r.overlayingShiftedAx=a;var i=W.drawOne(t,n,r);return n._shiftPusher&&jt(n,n._fullDepth||0,o,!0),n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}})))},W.drawOne=function(t,e,r){var n,i,l,d=(r=r||{}).axShifts||{},p=r.overlayingShiftedAx||[];e.setScale();var v=t._fullLayout,g=e._id,m=g.charAt(0),y=W.counterLetter(g),x=v._plots[e._mainSubplot];if(x){if(e._shiftPusher=e.autoshift||-1!==p.indexOf(e._id)||-1!==p.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var b=e.linewidth/2||0;"inside"===e.ticks&&(b+=e.ticklen),jt(e,b,d,!0),jt(e,e.shift||0,d,!1)}!0===r.skipTitle&&void 0!==e._shift||(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,d));var _=x[m+"axislayer"],w=e._mainLinePosition,M=w+=e._shift,T=e._mainMirrorPosition,A=e._vals=W.calcTicks(e),k=[e.mirror,M,T].join("_");for(n=0;n0?r.bottom-c:0,f))));var h=0,d=0;if(e._shiftPusher&&(h=Math.max(f,r.height>0?"l"===l?c-r.left:r.right-c:0),e.title.text!==v._dfltTitle[m]&&(d=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(d+=Lt(e))),e._fullDepth=Math.max(h,d)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1],g="number"==typeof e._shift?e._shift:0;if("x"===m){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,f),p.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var b=e._offset-r.left;b>0&&(n.xl=0,n.l=b)}}else if("l"===l?(e._depth=Math.max(r.height>0?c-r.left:0,f),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-c:0,f),n[l]=e._depth+g,p.reverse()),r.height>0){var _=r.bottom-(e._offset+e._length);_>0&&(n.yb=0,n.b=_);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[y]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==v._dfltTitle[m]&&(n[l]+=Lt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=f),!0===e.mirror||"ticks"===e.mirror?i[y]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[y]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}ft&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(Mt(n,e.automargin),Mt(i,e.automargin)),a.autoMargin(t,Ot(e),n),a.autoMargin(t,Ct(e),i),a.autoMargin(t,Rt(e),s)})),s.syncOrAsync(ut)}}function ht(t){var r=g+(t||"tick");return L[r]||(L[r]=function(t,e,r){var n,i,a,o;if(t._selections[e].size())n=1/0,i=-1/0,a=1/0,o=-1/0,t._selections[e].each((function(){var t=Et(this),e=h.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),a=Math.min(a,e.left),o=Math.max(o,e.right)}));else{var s=W.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(e,r,M)),L[r]}},W.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},W.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},W.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;return(o||n)&&(c+=h*V,f+=(t.linewidth||0)/2),(i||a)&&(c+=(t.linewidth||0)/2,f+=3),s&&"top"===u&&(f-=h*(1-V)),(i||n)&&(c=-c),"bottom"!==u&&"right"!==u||(f=-f),[l?c:0,s?f:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],a=e[1],o=t.range[0]>t.range[1],s=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside"),u=!s;if(r&&(r*=o?-1:1),n){var c=t.side;n*=s&&("top"===c||"left"===c)||u&&("bottom"===c||"right"===c)?1:-1}return"x"===t._id.charAt(0)?function(e){return l(i+t._offset+t.l2p(At(e))+r,a+n)}:function(e){return l(a+n,i+t._offset+t.l2p(At(e))+r)}},W.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},W.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),u=a("right"),c=a("bottom")||l||o||u,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,v=h?t.ticklen:0;if(f?v*=-1:c&&(v=0),h&&(d+=v,r)){var g=s.deg2rad(r);d=v*Math.cos(g)+1,p=v*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,x,b,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},M=0,T=t.side,A=t._id.charAt(0),k=t.tickangle;if("x"===A)b=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(b*=-1),m=p*b,y=e+d*b,x=_?1:-.2,90===Math.abs(k)&&(f?x+=H:x=-90===k&&"bottom"===T?V:90===k&&"top"===T?H:.5,M=H/2*(k/90)),w.xFn=function(t){return t.dx+m+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return i(e)&&0!==e&&180!==e?e*b<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===A){if(b=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(b*=-1),m=d,y=p*b,x=0,f||90!==Math.abs(k)||(x=-90===k&&"left"===T||90===k&&"right"===T?V:.5),f){var L=i(k)?+k:0;if(0!==L){var S=s.deg2rad(L);M=Math.abs(Math.sin(S))*V*b,x=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*x)*b+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*H},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},W.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,kt);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Bt(e,[N]),o.attr("transform",r.transFn)},W.drawGrid=function(t,e,r){if(r=r||{},"sync"!==e.tickmode){var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&W.shouldShowZeroLine(t,e,l))for(var u="array"===e.tickmode,c=0;c=0;m--){var y=m?v:g;if(y){var x=y.selectAll("path."+i).data(m?s:o,kt);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?p:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Bt(e,[z,F])}},W.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=W.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return Z(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Bt(e,[I])},W.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,c=r.cls||o+"tick",f=r.vals.filter((function(t){return t.text})),d=r.labelFns,p=r.secondary?0:e.tickangle,v=(e._prevTickAngles||{})[c],g=r.layer.selectAll("g."+c).data(e.showticklabels?f:[],kt),m=[];function y(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),c=d.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),p=u.lineCount(o),v=Y*t.fontSize,g=d.heightFn(t,i(a)?+a:0,(p-1)*v);if(g&&(f+=l(0,g)),s.empty()){var m=o.select("text");m.attr({transform:f,"text-anchor":c}),m.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var y=h.bBox(s.node()).width*{end:-.5,start:.5}[c];s.attr("transform",f+l(y,0))}}))}g.enter().append("g").classed(c,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(u.positionText,d.xFn(e),d.yFn(e)).call(h.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(u.convertToTspans,t),t._promises[i]?m.push(t._promises.pop().then((function(){y(r,p)}))):y(r,p)})),Bt(e,[B]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(t){n.select(this).select("text").call(u.positionText,d.xFn(t),d.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,u=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var c=s.simpleMap(e.range,e.r2l);l=e.l2p(c[0])+e._offset,u=e.l2p(c[1])+e._offset}var f=Math.min(l,u),d=Math.max(l,u),p=e.side,v=1/0,m=-1/0;for(var y in g.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>d||a.leftd||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},y(g,v+1?v:p);var x=null;e._selections&&(e._selections[c]=g);var b=[function(){return m.length&&Promise.all(m)}];e.automargin&&a._redrawFromAutoMarginCount&&90===v?(x=v,b.push((function(){y(g,v)}))):b.push((function(){if(y(g,p),f.length&&e.autotickangles&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=e.autotickangles[0];var t,n=0,i=[],a=1;g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),o=Et(this),s=h.bBox(o.node());a=Math.max(a,u.lineCount(o)),i.push({top:0,bottom:10,height:10,left:r-s.width/2,right:r+s.width/2+2,width:s.width+2})}));var o=("boundaries"===e.tickson||e.showdividers)&&!r.secondary,l=f.length,c=Math.abs((f[l-1].x-f[0].x)*e._m)/(l-1),d=o?c/2:c,v=o?e.ticklen:1.25*n*a,m=d/Math.sqrt(Math.pow(d,2)+Math.pow(v,2)),b=e.autotickangles.map((function(t){return t*Math.PI/180})),_=b.find((function(t){return Math.abs(Math.cos(t))<=m}));void 0===_&&(_=b.reduce((function(t,e){return Math.abs(Math.cos(t))j*P&&(C=P,S[L]=E[L]=R[L])}var U=Math.abs(C-O);U-T>0?T*=1+T/(U-=T):T=0,"y"!==e._id.charAt(0)&&(T=-T),S[k]=w.p2r(w.r2p(E[k])+A*T),"min"===w.autorange||"max reversed"===w.autorange?(S[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):"max"!==w.autorange&&"min reversed"!==w.autorange||(S[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=S}var H=s.syncOrAsync(b);return H&&H.then&&t._promises.push(H),H},W.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},W.shouldShowZeroLine=function(t,e,r){var n=s.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===P)&&(St(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var a=t._fullLayout,o=e._id.charAt(0),s=W.counterLetter(e._id),l=e._offset+(Math.abs(n[0])1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},c=0;c2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,u,c="";if(2===o.length)for(s=0;s<2;s++)if(u=_(o[s])){c=m;break}var f=i("pattern",c);if(f===m)for(s=0;s<2;s++)(u=_(o[s]))&&(e.bounds[s]=o[s]=u-1);if(f)for(s=0;s<2;s++)switch(u=o[s],f){case m:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[s]=o[s]=u;break;case y:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[s]=o[s]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},e.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},e.isLinked=function(t,e){return a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},4796:function(t,e,r){"use strict";var n=r(8116).isTypedArraySpec;t.exports=function(t,e,r,i){if("category"===e.type){var a,o=t.categoryarray,s=Array.isArray(o)&&o.length>0||n(o);s&&(a="array");var l,u=r("categoryorder",a);"array"===u&&(l=r("categoryarray")),s||"array"!==u||(u=e.categoryorder="trace"),"trace"===u?e._initialCategories=[]:"array"===u?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;ou*x)||M)for(r=0;rD&&FC&&(C=F);h/=(C-O)/(2*R),O=l.l2r(O),C=l.l2r(C),l.range=l._input.range=L=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Y(t){R&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),R=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function W(t,e,r,n,a){for(var o,s,l,u,c=!1,f={},h={},d=(a||{}).xaHash,p=(a||{}).yaHash,v=0;v=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(V(i),2!==t||mt||Yt(),gt)o.indexOf("select")>-1&&L(r,i,J,K,e.id,Ct),o.indexOf("event")>-1&&d.click(i,r,e.id);else if(1===t&&mt){var s=v?D:R,u="s"===v||"w"===m?0:1,f=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,u),p="left",g="middle";if(s.fixedrange)return;v?(g="n"===v?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),i._context.showAxisRangeEntryBoxes&&n.select(bt).call(c.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),i=Math.max(0,Math.min(et,pt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){Lt="",Mt.r=Mt.l,Mt.t=Mt.b,Et.attr("d","M0,0Z")}if(Mt.l=Math.min(_t,n),Mt.r=Math.max(_t,n),Mt.t=Math.min(wt,i),Mt.b=Math.max(wt,i),rt.isSubplotConstrained)a>C||o>C?(Lt="xy",a/tt>o/et?(o=a*et/tt,wt>i?Mt.t=wt-o:Mt.b=wt+o):(a=o*tt/et,_t>n?Mt.l=_t-a:Mt.r=_t+a),Et.attr("d",G(Mt))):s();else if(nt.isSubplotConstrained)if(a>C||o>C){Lt="xy";var l=Math.min(Mt.l/tt,(et-Mt.b)/et),u=Math.max(Mt.r/tt,(et-Mt.t)/et);Mt.l=l*tt,Mt.r=u*tt,Mt.b=(1-l)*et,Mt.t=(1-u)*et,Et.attr("d",G(Mt))}else s();else!at||o0){var c;if(nt.isSubplotConstrained||!it&&1===at.length){for(c=0;c1&&(void 0!==a.maxallowed&&st===(a.range[0]1&&(void 0!==o.maxallowed&<===(o.range[0]0){var g=d.id;if(-1!==g.indexOf(p))continue;g+=p+(c+1),d=a.extendFlat({},d,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var m,y=[],x=0;x1&&(w+=p+_),b.push(n+w),r=0;rb[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return r("layer"),e}},2568:function(t,e,r){"use strict";var n=r(5024);t.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},6312:function(t,e,r){"use strict";var n=r(6808);t.exports=function(t,e,r,i){var a=e._template||{},o=e.type||a.type||"-";r("minallowed"),r("maxallowed");var s,l=r("range");l||i.noInsiderange||"log"===o||(!(s=r("insiderange"))||null!==s[0]&&null!==s[1]||(e.insiderange=!1,s=void 0),s&&(l=r("range",s)));var u,c=e.getAutorangeDflt(l,i),f=r("autorange",c);!l||(null!==l[0]||null!==l[1])&&(null!==l[0]&&null!==l[1]||"reversed"!==f&&!0!==f)&&(null===l[0]||"min"!==f&&"max reversed"!==f)&&(null===l[1]||"max"!==f&&"min reversed"!==f)||(l=void 0,delete e.range,e.autorange=!0,u=!0),u||(f=r("autorange",c=e.getAutorangeDflt(l,i))),f&&(n(r,f,l),"linear"!==o&&"-"!==o||r("rangemode")),e.cleanRange()}},1160:function(t,e,r){"use strict";var n=r(4284).FROM_BL;t.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},8344:function(t,e,r){"use strict";var n=r(3428),i=r(4336).E9,a=r(3400),o=a.numberFormat,s=r(8248),l=a.cleanNumber,u=a.ms2DateTime,c=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,d=r(9032),p=d.FP_SAFE,v=d.BADNUM,g=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,x=d.ONEHOUR,b=d.ONEMIN,_=d.ONESEC,w=r(9811),M=r(3816),T=M.HOUR_PATTERN,A=M.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function L(t){return null!=t}t.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function S(e,r){if(e>0)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-2*g*Math.abs(n-i))}return v}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===v){if(!s(e))return v;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function O(e,r,n){return u(e,r,n||t.calendar)}function C(e){return t._categories[Math.round(e)]}function R(e){if(L(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return v}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function I(t){return s(t)?+t:D(t)}function z(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var N=function(e){return s(e)?z(e,t._m,t._b):v},B=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;N=function(e){if(!s(e))return v;var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lc)){o=a<(u+c)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?z(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:f,t.l2c="log"===t.type?k:f,t.l2p=N,t.p2l=B,t.c2p="log"===t.type?function(t,e){return N(S(t,e))}:N,t.p2c="log"===t.type?function(t){return k(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=S,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=O,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return O(B(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,v,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=R,t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(i=0;il[1]&&(i[s?0:1]=n),i[0]===i[1]){var u=t.l2r(r),c=t.l2r(n);if(void 0!==r){var f=u+1;void 0!==n&&(f=Math.min(f,c)),i[s?1:0]=f}if(void 0!==n){var h=c+1;void 0!==r&&(h=Math.max(h,u)),i[s?0:1]=h}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,o=a.nestedProperty(t,e).get();if(i=(i="date"===t.type?a.dfltRange(t.calendar):"y"===d?M.DFLTRANGEY:"realaxis"===t._name?[0,1]:r.dfltRange||M.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(i[0]=0),o&&2===o.length){var l=null===o[0],u=null===o[1];for("date"!==t.type||t.autorange||(o[0]=a.cleanDate(o[0],v,t.calendar),o[1]=a.cleanDate(o[1],v,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!a.isDateTime(o[n],t.calendar)){t[e]=i;break}if(t.r2l(o[0])===t.r2l(o[1])){var c=a.constrain(t.r2l(o[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);o[0]=t.l2r(c-1e3),o[1]=t.l2r(c+1e3);break}}else{if(!s(o[n])){if(l||u||!s(o[1-n])){t[e]=i;break}o[n]=o[1-n]*(n?10:.1)}if(o[n]<-p?o[n]=-p:o[n]>p&&(o[n]=p),o[0]===o[1]){var f=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=f,o[1]+=f}}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),f="y"===d;if(f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(f?c:u)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&u.push({min:t,max:n})}};for(n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=a.simpleMap(e.xr0,i.r2l),v=a.simpleMap(e.xr1,i.r2l),g=p[1]-p[0],m=v[1]-v[0];d[0]=(p[0]*(1-r)+r*v[0]-p[0])/(p[1]-p[0])*u,d[2]=u*(1-r+r*m/g),i.range[0]=i.l2r(p[0]*(1-r)+r*v[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*v[1])}else d[0]=0,d[2]=u;if(h){var y=a.simpleMap(e.yr0,l.r2l),x=a.simpleMap(e.yr1,l.r2l),b=y[1]-y[0],_=x[1]-x[0];d[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*c,d[3]=c*(1-r+r*_/b),l.range[0]=i.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else d[1]=0,d[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?u/d[2]:1,M=h?c/d[3]:1,T=f?d[0]:0,A=h?d[1]:0,k=f?d[0]/d[2]*u:0,L=h?d[1]/d[3]*c:0,S=i._offset-k,E=l._offset-L;n.clipRect.call(o.setTranslate,T,A).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,S,E).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}s.redrawComponents(t)}},4944:function(t,e,r){"use strict";var n=r(4040).traceIs,i=r(2976);function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}t.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(function(t,e){if("-"===t.type){var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(u)if("histogram"!==u.type||l!=={v:"y",h:"x"}[u.orientation||"v"]){var c=l+"calendar",f=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};if("box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0),h.autotypenumbers=t.autotypenumbers,o(u,l)){var d=a(u),p=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}e.manageCommandObserver=function(t,r,n,o){var s={},l=!0;r&&r._commandObserver&&(s=r._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=e.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(r&&r._commandObserver){if(u)return s;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}t.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:c,attributes:l,handleDefaults:f,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},346:function(t,e,r){"use strict";var n=r(6140),i=r(6968).u,a=r(2880).extendFlat,o=r(3400).counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}t.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},9020:function(t,e,r){"use strict";var n=r(696),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},t.exports=function(t){var e=new a;return e.merge(t),e}},4772:function(t,e,r){"use strict";t.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[a[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var d=n.calcTicks(c,{msUTC:!0}),p=0;p/g," "));l[u]=d,c.tickmode=f}}for(e.ticks=l,u=0;u<3;++u)for(o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]),p=0;p<2;++p)e.bounds[p][u]=t.glplot.bounds[p][u];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!u&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},T.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(e),e.glplot.axes.update(e.axesOptions);for(var u=Object.keys(e.traces),c=null,h=e.glplot.selection,v=0;v")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=d.hoverLabelText(e._mockAxis,e._mockAxis.d2l(h.traceCoordinate[3]),t.valuehoverformat),S.push("value: "+T.valueLabel),h.textLabel&&S.push(h.textLabel),x=S.join("
")):x=h.textLabel;var E={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:M};p.appendArrayPointValue(E,_,M),t._module.eventData&&(E=_._module.eventData(E,h,_,{},M));var O={points:[E]};if(e.fullSceneLayout.hovermode){var C=[];p.loneHover({trace:_,x:(.5+.5*y[0]/y[3])*s,y:(.5-.5*y[1]/y[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:x,name:c.name,color:p.castHoverOption(_,M,"bgcolor")||c.color,borderColor:p.castHoverOption(_,M,"bordercolor"),fontFamily:p.castHoverOption(_,M,"font.family"),fontSize:p.castHoverOption(_,M,"font.size"),fontColor:p.castHoverOption(_,M,"font.color"),nameLength:p.castHoverOption(_,M,"namelength"),textAlign:p.castHoverOption(_,M,"align"),hovertemplate:f.castOption(_,M,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,T),eventData:[E]},{container:n,gd:r,inOut_bbox:C}),E.bbox=C[0]}h.distance<5&&(h.buttons||w)?r.emit("plotly_click",O):r.emit("plotly_hover",O),this.oldEventData=O}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},T.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function L(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],c=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,d=0;d<(c||l.length);d++)if(f.isArrayOrTypedArray(l[d]))for(var p=0;pm[1][o])m[0][o]=-1,m[1][o]=1;else{var R=m[1][o]-m[0][o];m[0][o]-=R/32,m[1][o]+=R/32}if(b=[m[0][o],m[1][o]],b=_(b,l),m[0][o]=b[0],m[1][o]=b[1],l.isReversed()){var D=m[0][o];m[0][o]=m[1][o],m[1][o]=D}}else b=l.range,m[0][o]=l.r2l(b[0]),m[1][o]=l.r2l(b[1]);m[0][o]===m[1][o]&&(m[0][o]-=1,m[1][o]+=1),y[o]=m[1][o]-m[0][o],l.range=[m[0][o],m[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*d[o],max:l.range[1]*d[o]})}var P=c.aspectmode;if("cube"===P)g=[1,1,1];else if("manual"===P){var I=c.aspectratio;g=[I.x,I.y,I.z]}else{if("auto"!==P&&"data"!==P)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(o=0;o<3;++o){var F=x[u=(l=c[k[o]]).type];z[o]=Math.pow(F.acc,1/F.count)/d[o]}g="data"===P||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}c.aspectratio.x=f.aspectratio.x=g[0],c.aspectratio.y=f.aspectratio.y=g[1],c.aspectratio.z=f.aspectratio.z=g[2],n.glplot.setAspectratio(c.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=c.aspectmode);var N=c.domain||null,B=e._size||null;if(N&&B){var j=n.container.style;j.position="absolute",j.left=B.l+N.x[0]*B.w+"px",j.top=B.t+(1-N.y[1])*B.h+"px",j.width=B.w*(N.x[1]-N.x[0])+"px",j.height=B.h*(N.y[1]-N.y[0])+"px"}n.glplot.redraw()}},T.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},T.getCamera=function(){var t,e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),{up:{x:(t=e.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},T.setViewport=function(t){var e,r=this,n=t.camera;r.camera.lookAt.apply(this,[[(e=n).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),r.glplot.setAspectratio(t.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},T.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},T.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},T.saveLayout=function(t){var e,r,n,i,a,o,s=this,l=s.fullLayout,u=s.isCameraChanged(t),h=s.isAspectChanged(t),d=u||h;if(d){var p={};u&&(e=s.getCamera(),n=(r=f.nestedProperty(t,s.id+".camera")).get(),p[s.id+".camera"]=n),h&&(i=s.glplot.getAspectratio(),o=(a=f.nestedProperty(t,s.id+".aspectratio")).get(),p[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,l._preGUI,p),u&&(r.set(e),f.nestedProperty(l,s.id+".camera").set(e)),h&&(a.set(i),f.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return d},T.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,u=o.up.z;if(u/Math.sqrt(s*s+l*l+u*u)<.999){var h=r.id+".camera.up",d={x:0,y:0,z:1},p={};p[h]=d;var v=i.layout;c.call("_storeDirectGUIEdit",v,a._preGUI,p),o.up=d,f.nestedProperty(v,h).set(d)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},T.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(n),e.glplot.redraw();var r=e.glplot.gl,i=r.drawingBufferWidth,a=r.drawingBufferHeight;r.bindFramebuffer(r.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);r.readPixels(0,0,i,a,r.RGBA,r.UNSIGNED_BYTE,o),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,u=s.getContext("2d",{willReadFrequently:!0}),c=u.createImageData(i,a);switch(c.data.set(o),u.putImageData(c,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(n),l},T.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];d.setConvert(e,this.fullLayout),e.setScale=f.noop}},T.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(t._mockAxis,e)},t.exports=M},2094:function(t){"use strict";t.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;a=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.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(){w.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()?" - ":"")}},w.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=w.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function L(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&P.length>1){for(l.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&P.length>15&&0===s.shapes.length&&0===s.images.length,w.linkSubplots(h,s,c,n),w.cleanPlot(h,s,c,n);var B=!(!n._has||!n._has("gl2d")),j=!(!s._has||!s._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!s._has||!s._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&v({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var c=1-2*s;n=Math.round(c*n),i=Math.round(c*i)}}var h=w.layoutAttributes.width.min,d=w.layoutAttributes.height.min;n1,v=!e.height&&Math.abs(r.height-i)>1;(v||p)&&(p&&(r.width=n),v&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),w.sanitizeMargins(r)},w.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,u=e._basePlotModules,c=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(c),e._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(t,e),c.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(f.subplotSort);for(a=0;a1&&(r.l/=m,r.r/=m)}if(d){var y=(r.t+r.b)/d;y>1&&(r.t/=y,r.b/=y)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,_=void 0!==r.yt?r.yt:r.y,M=void 0!==r.yb?r.yb:r.y;p[e]={l:{val:x,size:r.l+g},r:{val:b,size:r.r+g},b:{val:M,size:r.b+g},t:{val:_,size:r.t+g}},v[e]=1}else delete p[e],delete v[e];if(!n._replotting)return w.doAutoMargin(t)}},w.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),R(e);var i=e._size,a=e.margin,s={t:0,b:0,l:0,r:0},u=f.extendFlat({},i),c=a.l,h=a.r,d=a.t,v=a.b,g=e._pushmargin,m=e._pushmarginIds,y=e.minreducedwidth,x=e.minreducedheight;if(!1!==a.autoexpand){for(var b in g)m[b]||delete g[b];var _=t._fullLayout._reservedMargin;for(var M in _)for(var T in _[M]){var A=_[M][T];s[T]=Math.max(s[T],A)}for(var k in g.base={l:{val:0,size:c},r:{val:1,size:h},t:{val:1,size:d},b:{val:0,size:v}},s){var L=0;for(var S in g)"base"!==S&&o(g[S][k].size)&&(L=g[S][k].size>L?g[S][k].size:L);var E=Math.max(0,a[k]-L);s[k]=Math.max(0,s[k]-E)}for(var O in g){var C=g[O].l||{},D=g[O].b||{},P=C.val,I=C.size,z=D.val,F=D.size,N=r-s.r-s.l,B=n-s.t-s.b;for(var j in g){if(o(I)&&g[j].r){var U=g[j].r.val,H=g[j].r.size;if(U>P){var V=(I*U+(H-N)*P)/(U-P),Y=(H*(1-P)+(I-N)*(1-U))/(U-P);V+Y>c+h&&(c=V,h=Y)}}if(o(F)&&g[j].t){var G=g[j].t.val,W=g[j].t.size;if(G>z){var q=(F*G+(W-B)*z)/(G-z),X=(W*(1-z)+(F-B)*(1-G))/(G-z);q+X>v+d&&(v=q,d=X)}}}}}var Z=f.constrain(r-a.l-a.r,2,y),J=f.constrain(n-a.t-a.b,2,x),K=Math.max(0,r-Z),Q=Math.max(0,n-J);if(K){var $=(c+h)/K;$>1&&(c/=$,h/=$)}if(Q){var tt=(v+d)/Q;tt>1&&(v/=tt,d/=tt)}if(i.l=Math.round(c)+s.l,i.r=Math.round(h)+s.r,i.t=Math.round(d)+s.t,i.b=Math.round(v)+s.b,i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(w.didMarginChange(u,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=p.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(m).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return l.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function s(){return a++,function(){var e;o++,n||o!==a||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)))}}r.runFn(s),setTimeout(s())}))}],a=f.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}w.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},w.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&w.supplyDefaults(t);var o=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(f.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!f.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}var a=Array.isArray(t),o=f.isTypedArray(t);if((a||o)&&t.dtype&&t.shape){var l=t.bdata;return c({dtype:t.dtype,shape:t.shape,bdata:f.isArrayBuffer(l)?s.encode(l):l},e)}return a?t.map((function(t){return c(t,e)})):o?f.simpleMap(t,f.identity):f.isJSDate(t)?f.ms2DateTimeLocal(+t):t}var h={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(h.layout=c(l),i)){var d=l._size;h.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return u&&(h.frames=c(u)),a&&(h.config=c(t._context,!0)),"object"===n?h:JSON.stringify(h)},w.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(l[a].enabled){r._indexToPoints=l[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[e]=o}}for(z(o,s,c),i=0;i0){for(var n=[],i=0;i-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(w)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},6376:function(t,e,r){"use strict";var n=r(8248),i=r(3400).isArrayOrTypedArray,a=r(9032).BADNUM,o=r(4040),s=r(4460),l=r(1888).getAxisGroup,u=r(2592);function c(t,e,r,o,c){if(o.length){var b,_,w,M;switch(function(t,e){var r,a;for(r=0;rf+u||!n(c))}for(var d=0;d=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort((function(t,e){return e[2]-t[2]}))}},448:function(t,e,r){"use strict";var n=r(3400),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,u,c,f,h,d,p,v,g,m=0;for(s=0;sv&&(m=Math.max(m,Math.abs(t[a][o]-p)/(g-v))))}return m}t.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},48:function(t,e,r){"use strict";var n=r(9084),i=r(9736).axisHoverFormat,a=r(1776).Ks,o=r(2948),s=r(5464),l=r(2880).extendFlat,u=r(7824).overrideAll,c=t.exports=u(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes",c.transforms=void 0},2624:function(t,e,r){"use strict";var n=r(7128),i=r(3832).processGrid,a=r(3832).filter;t.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function z(t,e){return null===t?e:t}function F(e,r,n){O();var i,a,o,l=[r],u=[n];if(s>=1)l=[r],u=[n];else if(s>0){var c=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[d]:E(p,v,m);h[d]=x>-1?x:R(p,v,m,z(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function N(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(S-L);return t>=L-e&&t<=S+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}var H=3;function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,i),B(e[1][3],n,i),B(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):aMath.abs(E-k)?[A,E]:[E,k];p=!0,$(r,O[0],O[1]),p=!1}}var D=[[Math.min(L,k),Math.max(L,k)],[Math.min(A,S),Math.max(A,S)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(f.push(p.id),"x"===r?h.push([p.distRatio,0,0]):"y"===r?h.push([0,p.distRatio,0]):h.push([0,0,p.distRatio]))}else c=nt(1,"x"===r?b-1:"y"===r?_-1:w-1);f.length>0&&(n[a]="x"===r?tt(e,f,o,s,h,n[a]):"y"===r?et(e,f,o,s,h,n[a]):rt(e,f,o,s,h,n[a]),a++),c.length>0&&(n[a]="x"===r?J(e,c,o,s,n[a]):"y"===r?K(e,c,o,s,n[a]):Q(e,c,o,s,n[a]),a++)}var v=t.caps[r];v.show&&v.fill&&(P(v.fill),n[a]="x"===r?J(e,[0,b-1],o,s,n[a]):"y"===r?K(e,[0,_-1],o,s,n[a]):Q(e,[0,w-1],o,s,n[a]),a++)}})),0===g&&C(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=m,t._Ys=y,t._Zs=x}(),t}t.exports={findNearestOnAxis:u,generateIsoMeshes:d,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},548:function(t,e,r){"use strict";var n=r(3400),i=r(4040),a=r(48),o=r(7260);function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var u=a("x"),c=a("y"),f=a("z"),h=a("value");u&&u.length&&c&&c.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}t.exports={supplyDefaults:function(t,e,r,i){s(t,e,0,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},6296:function(t,e,r){"use strict";t.exports={attributes:r(48),supplyDefaults:r(548).supplyDefaults,calc:r(2624),colorbar:{min:"cmin",max:"cmax"},plot:r(1460).createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:r(2536),categories:["gl3d","showLegend"],meta:{}}},2948:function(t,e,r){"use strict";var n=r(9084),i=r(9736).axisHoverFormat,a=r(1776).Ks,o=r(9096),s=r(5464),l=r(2880).extendFlat;t.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},1876:function(t,e,r){"use strict";var n=r(7128);t.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},576:function(t,e,r){"use strict";var n=r(5411).gl_mesh3d,i=r(5411).delaunay_triangulate,a=r(5411).alpha_shape,o=r(5411).convex_hull,s=r(3040).parseColorScale,l=r(3400).isArrayOrTypedArray,u=r(696),c=r(8932).extractOpts,f=r(2094);function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var d=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}d.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return l(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},d.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,l=t.x.length,h=f(v(r.xaxis,t.x,e.dataScale[0],t.xcalendar),v(r.yaxis,t.y,e.dataScale[1],t.ycalendar),v(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!m(t.i,l)||!m(t.j,l)||!m(t.k,l))return;n=f(g(t.i),g(t.j),g(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ol&&O[m].gap;)m--;for(x=O[m].s,v=O.length-1;v>m;v--)O[v].s=x;for(;lL[f]&&f=0;f--){var h=t[f];if("scatter"===h.type&&h.xaxis===u.xaxis&&h.yaxis===u.yaxis){h.opacity=void 0;break}}}}}},8800:function(t,e,r){"use strict";var n=r(3400),i=r(4040),a=r(2904),o=r(8200),s=r(3028),l=r(3980),u=r(1147),c=r(3912),f=r(4428),h=r(6828),d=r(1731),p=r(124),v=r(840),g=r(3400).coercePattern;t.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var x=l(t,e,m,y);if(x||(e.visible=!1),e.visible){u(t,e,m,y),y("xhoverformat"),y("yhoverformat"),y("zorder");var b=c(t,e,m,y);"group"===m.scattermode&&void 0===e.orientation&&y("orientation","v");var _=!b&&x=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-p);return a=Math.min(e,r)&&v<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(d.c2p(t.y)-v);return ar!=(u=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],u-l&&(a=o+(s-o)*(r-l)/(u-l),f=Math.min(f,a),p=Math.max(p,a)));return{x0:f=Math.max(f,0),x1:p=Math.min(p,h._length),y0:r,y1:r}}(f._polygons);null===R&&(R={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var D=s.defaultLine;return s.opacity(f.fillcolor)?D=f.fillcolor:s.opacity((f.line||{}).color)&&(D=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:R.x0,x1:R.x1,y0:R.y0,y1:R.y1,color:D,hovertemplate:!1}),delete t.index,f.text&&!n.isArrayOrTypedArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}},5875:function(t,e,r){"use strict";var n=r(3028);t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:r(2904),layoutAttributes:r(5308),supplyDefaults:r(8800),crossTraceDefaults:r(5036),supplyLayoutDefaults:r(9748),calc:r(6356).calc,crossTraceCalc:r(6664),arraysToCalcdata:r(148),plot:r(6504),colorbar:r(5528),formatLabels:r(6688),style:r(6844).style,styleOnSelect:r(6844).styleOnSelect,hoverPoints:r(8723),selectPoints:r(1560),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:r(7952),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},5308:function(t){"use strict";t.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},9748:function(t,e,r){"use strict";var n=r(3400),i=r(5308);t.exports=function(t,e){var r,a="group"===e.barmode;"group"===e.scattermode&&("scattergap",r=a?e.bargap:.2,n.coerce(t,e,i,"scattergap",r))}},6828:function(t,e,r){"use strict";var n=r(3400).isArrayOrTypedArray,i=r(4288).hasColorscale,a=r(7260);t.exports=function(t,e,r,o,s,l){l||(l={});var u=(t.marker||{}).color;u&&u._inputArray&&(u=u._inputArray),s("line.color",r),i(t,"line")?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},2340:function(t,e,r){"use strict";var n=r(3616),i=r(9032),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,u=r(3400),c=u.segmentsIntersect,f=u.constrain,h=r(8200);t.exports=function(t,e){var r,i,o,d,p,v,g,m,y,x,b,_,w,M,T,A,k,L,S=e.trace||{},E=e.xaxis,O=e.yaxis,C="log"===E.type,R="log"===O.type,D=E._length,P=O._length,I=e.backoff,z=S.marker,F=e.connectGaps,N=e.baseTolerance,B=e.shape,j="linear"===B,U=S.fill&&"none"!==S.fill,H=[],V=h.minTolerance,Y=t.length,G=new Array(Y),W=0;function q(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),o=e.linearized?O.l2p(n.y):O.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;R&&o===a&&(i*=Math.abs(E._m*P*(E._m>0?s:l)/(O._m*D*(O._m>0?s:l)))),i*=1e3}if(o===a){if(R&&(o=O.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function X(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&uot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0}function ht(t,e,r){return function(n,i){var a=ct(n),o=ct(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*u.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l),s}}function dt(t){var e=t[0],r=t[1],n=e===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=e===G[W-2][0],o=r===G[W-2][1];n&&(e===at||e===ot)&&a?o?W--:G[W-1]=t:i&&(r===st||r===lt)&&o?a?W--:G[W-1]=t:G[W++]=t}else G[W++]=t}function pt(t){G[W-1][0]!==t[0]&&G[W-1][1]!==t[1]&&dt([$,tt]),dt(t),et=null,$=tt=0}"linear"===B||"spline"===B?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ut[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(W)if(et){var n=nt(et,e);n.length>1&&(pt(n[0]),G[W++]=n[1])}else rt=nt(G[W-1],e)[0],G[W++]=rt;else G[W++]=[K||e[0],Q||e[1]];var i=G[W-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?dt($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&dt([$,tt])),dt([K,Q])):$-K&&tt-Q&&dt([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&pt(nt(et,e)[0]),G[W++]=e;var a,o,s,l}for(r=0;rZ(v,mt))break;o=v,(w=y[0]*m[0]+y[1]*m[1])>b?(b=w,d=v,g=!1):w<_&&(_=w,p=v,g=!0)}if(g?(gt(d),o!==p&>(p)):(p!==i&>(p),o!==d&>(d)),gt(o),r>=t.length||!v)break;gt(v),i=v}}else gt(d)}et&&dt([$||et[0],tt||et[1]]),H.push(G.slice(0,W))}var yt=B.slice(B.length-1);if(I&&"h"!==yt&&"v"!==yt){for(var xt=!1,bt=-1,_t=[],wt=0;wt=0?l=d:(l=d=h,h++),l0?Math.max(r,a):0}}},5528:function(t){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},4428:function(t,e,r){"use strict";var n=r(6308),i=r(4288).hasColorscale,a=r(7260),o=r(3028);t.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),u.noAngle||(l("marker.angle"),u.noAngleRef||l("marker.angleref"),u.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},1147:function(t,e,r){"use strict";var n=r(3400).dateTick0,i=r(9032).ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}t.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},6504:function(t,e,r){"use strict";var n=r(3428),i=r(4040),a=r(3400),o=a.ensureSingle,s=a.identity,l=r(3616),u=r(3028),c=r(2340),f=r(4328),h=r(2065).tester;function d(t,e,r,f,d,p,v){var g,m=t._context.staticPlot;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(u.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=i.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),v=Math.ceil(p.length/d),g=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(t){return y?t.transition():t}var b=r.xaxis,_=r.yaxis,w=f[0].trace,M=w.line,T=n.select(p),A=o(T,"g","errorbars"),k=o(T,"g","lines"),L=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,A,r,v),!0===w.visible){var E,O;x(T).style("opacity",w.opacity);var C,R,D=w.fill.charAt(w.fill.length-1);"x"!==D&&"y"!==D&&(D=""),"y"===D?(C=1,R=_.c2p(0,!0)):"x"===D&&(C=0,R=b.c2p(0,!0)),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,z="",F=[],N=w._prevtrace,B=null,j=null;N&&(z=N._prevRevpath||"",O=N._nextFill,F=N._ownPolygons,B=N._fillsegments,j=N._fillElement);var U,H,V,Y,G,W,q="",X="",Z=[];w._polygons=[];var J=[],K=[],Q=a.noop;if(E=w._ownFill,u.hasLines(w)||"none"!==w.fill){O&&O.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(M.shape)?(U=l.steps(M.shape),H=l.steps(M.shape.split("").reverse().join(""))):U=H="spline"===M.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),M.smoothing):l.smoothopen(t,M.smoothing)}:function(t){return"M"+t.join("L")},V=function(t){return H(t.reverse())},K=c(f,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(M.width||1,3)/4,shape:M.shape,backoff:M.backoff,simplify:M.simplify,fill:w.fill}),J=new Array(K.length);var $=0;for(g=0;g0,g=f(t,e,r);(c=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){a[t]=null})).remove(),c.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),v?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,g,this,a)}))}))):c.each((function(r,n){d(t,n,e,r,g,this,a)})),p&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},1560:function(t,e,r){"use strict";var n=r(3028);t.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}t.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return d[t]}function M(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var S=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",d||p);for(var v=["x","y","z"],g=0;g<3;++g){var m="projection."+v[g];f(m+".show")&&(f(m+".opacity"),f(m+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,d||p||r,{axis:"z"}),y(t,e,d||p||r,{axis:"y",inherit:"z"}),y(t,e,d||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},3296:function(t,e,r){"use strict";t.exports={plot:r(1064),attributes:r(9212),markerSymbols:r(5412),supplyDefaults:r(3484),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:r(1484),moduleType:"trace",name:"scatter3d",basePlotModule:r(2536),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},167:function(t,e,r){"use strict";var n=r(9084),i=r(9736).axisHoverFormat,a=r(1776).Ks,o=r(2948),s=r(5464),l=r(2880).extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(t){u[t]=o[t]})),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,t.exports=u},3832:function(t,e,r){"use strict";var n=r(3400),i=r(7128);function a(t){var e,r,i,a,s,l,u,c,f,h,d,p,v=t._x,g=t._y,m=t._z,y=t._len,x=-1/0,b=1/0,_=-1/0,w=1/0,M=-1/0,T=1/0,A="";for(y&&(u=v[0],f=g[0],d=m[0]),y>1&&(c=v[y-1],h=g[y-1],p=m[y-1]),e=0;ec?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(d>p?"-":"+")+"z");var E=function(){y=0,k=[],L=[],S=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,i=t.dataScale,c=e._len,f={};function p(t,e){var n=r[e],o=i[u[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(p(e._u,"xaxis"),p(e._v,"yaxis"),p(e._w,"zaxis"),c),!c)return{positions:[],cells:[]};var v=p(e._Xs,"xaxis"),g=p(e._Ys,"yaxis"),m=p(e._Zs,"zaxis");if(f.meshgrid=[v,g,m],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(p(e._startsX,"xaxis"),p(e._startsY,"yaxis"),p(e._startsZ,"zaxis"));else{for(var y=g[0],x=h(v),b=h(m),_=new Array(x.length*b.length),w=0,M=0;M0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=m(r),++r1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,u=1+a+1,c=i(new Float32Array(l*u),[l,u]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]i&&(i=c,o=u)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return d(t)>f};case">=":return function(t){return d(t)>=f};case"[]":return function(t){var e=d(t);return e>=f[0]&&e<=f[1]};case"()":return function(t){var e=d(t);return e>f[0]&&e=f[0]&&ef[0]&&e<=f[1]};case"][":return function(t){var e=d(t);return e<=f[0]||e>=f[1]};case")(":return function(t){var e=d(t);return ef[1]};case"](":return function(t){var e=d(t);return e<=f[0]||e>f[1]};case")[":return function(t){var e=d(t);return e=f[1]};case"{}":return function(t){return-1!==f.indexOf(d(t))};case"}{":return function(t){return-1===f.indexOf(d(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),x={},b={},_=0;p?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=x[t.astr][e];t.get().push(r)}),T(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(a=0;ah)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}function p(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return m(t)}return v(t,e,r)}function v(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|_(t,e),n=d(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(et(t,Uint8Array)){var e=new Uint8Array(t);return x(e.buffer,e.byteOffset,e.byteLength)}return y(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t));if(et(t,ArrayBuffer)||t&&et(t.buffer,ArrayBuffer))return x(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(et(t,SharedArrayBuffer)||t&&et(t.buffer,SharedArrayBuffer)))return x(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return p.from(n,e,r);var i=function(t){if(p.isBuffer(t)){var e=0|b(t.length),r=d(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||rt(t.length)?d(0):y(t):"Buffer"===t.type&&Array.isArray(t.data)?y(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t))}function g(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function m(t){return g(t),d(t<0?0:0|b(t))}function y(t){for(var e=t.length<0?0:0|b(t.length),r=d(e),n=0;n=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return 0|t}function _(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||et(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+l(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:Q(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return z(this,e,r);case"utf8":case"utf-8":return R(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function M(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function T(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),rt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=p.from(e,n)),p.isBuffer(e))return 0===e.length?-1:A(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):A(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function A(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function C(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function R(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,u=void 0,c=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(p.isBuffer(a)||(a=p.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!p.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},p.byteLength=_,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},f&&(p.prototype[f]=p.prototype.inspect),p.prototype.compare=function(t,e,r,n,i){if(et(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),!p.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+l(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return k(this,t,e,r);case"utf8":case"utf-8":return L(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function P(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,a){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function U(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function H(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(t,e,r,n,i){return e=+e,r>>>=0,i||H(t,0,r,4),c.write(t,e,r,n,23,4),r+4}function Y(t,e,r,n,i){return e=+e,r>>>=0,i||H(t,0,r,8),c.write(t,e,r,n,52,8),r+8}p.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},p.prototype.readUint8=p.prototype.readUInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),this[t]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]|this[t+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]<<8|this[t+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},p.prototype.readBigUInt64LE=it((function(t){Z(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||N(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},p.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},p.prototype.readInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},p.prototype.readInt16LE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},p.prototype.readInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},p.prototype.readBigInt64LE=it((function(t){Z(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||N(t,4,this.length),c.read(this,t,!0,23,4)},p.prototype.readFloatBE=function(t,e){return t>>>=0,e||N(t,4,this.length),c.read(this,t,!1,23,4)},p.prototype.readDoubleLE=function(t,e){return t>>>=0,e||N(t,8,this.length),c.read(this,t,!0,52,8)},p.prototype.readDoubleBE=function(t,e){return t>>>=0,e||N(t,8,this.length),c.read(this,t,!1,52,8)},p.prototype.writeUintLE=p.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},p.prototype.writeUint8=p.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},p.prototype.writeBigUInt64LE=it((function(t){return j(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),p.prototype.writeBigUInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),p.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},p.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},p.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},p.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},p.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},p.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},p.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},p.prototype.writeBigInt64LE=it((function(t){return j(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),p.prototype.writeBigInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),p.prototype.writeFloatLE=function(t,e,r){return V(this,t,e,!0,r)},p.prototype.writeFloatBE=function(t,e,r){return V(this,t,e,!1,r)},p.prototype.writeDoubleLE=function(t,e,r){return Y(this,t,e,!0,r)},p.prototype.writeDoubleBE=function(t,e,r){return Y(this,t,e,!1,r)},p.prototype.copy=function(t,e,r,n){if(!p.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function X(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new G.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){Z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||J(e,t.length-(r+1))}(n,i,a)}function Z(t,e){if("number"!=typeof t)throw new G.ERR_INVALID_ARG_TYPE(e,"number",t)}function J(t,e,r){if(Math.floor(t)!==t)throw Z(t,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}W("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),W("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(l(e))}),TypeError),W("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=q(i)),i+="n"),n+" It must be ".concat(e,". Received ").concat(i)}),RangeError);var K=/[^+/0-9A-Za-z-_]/g;function Q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function $(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function rt(t){return t!=t}var nt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function it(t){return"undefined"==typeof BigInt?at:t}function at(){throw new Error("BigInt not supported")}},9216:function(t){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(t,e,r){"use strict";t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),f=i(),h=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:c,orbit:f,matrix:h},u)};var n=r(7261),i=r(9977),a=r(4192);function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map((function(e){return t[e]})),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r0?o-4:o;for(r=0;r>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var i,a,o=[],s=e;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},1318:function(t){"use strict";t.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},8697:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},7842:function(t,e,r){"use strict";var n=r(6330),i=r(1533),a=r(2651),o=r(4387),s=r(869),l=r(8697);t.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,f=0;if(i(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))u=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=a(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(i(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=a(r)}else c=a(1);return f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f)),s(u,c)}},6330:function(t,e,r){"use strict";var n=r(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716:function(t,e,r){"use strict";var n=r(6859);t.exports=function(t){return t.cmp(new n(0))}},1369:function(t,e,r){"use strict";var n=r(5716);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},1533:function(t,e,r){"use strict";r(6859),t.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},2651:function(t,e,r){"use strict";var n=r(6859),i=r(2361);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},869:function(t,e,r){"use strict";var n=r(2651),i=r(5716);t.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},4387:function(t,e,r){"use strict";var n=r(6859);t.exports=function(t){return new n(t)}},6504:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},7721:function(t,e,r){"use strict";var n=r(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},946:function(t,e,r){"use strict";var n=r(1369),i=r(4025);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4;return u*(s+(h=n(l.ushln(c).divRound(r)))*Math.pow(2,-c))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?u*h*Math.pow(2,-f):u*(h*=Math.pow(2,-1023))*Math.pow(2,1023-f)}},2478:function(t){"use strict";function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},8828:function(t,e){"use strict";function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6859:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;c+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?v+r:c[u-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,d=0|o[1],p=8191&d,v=d>>>13,g=0|o[2],m=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],M=8191&w,T=w>>>13,A=0|o[5],k=8191&A,L=A>>>13,S=0|o[6],E=8191&S,O=S>>>13,C=0|o[7],R=8191&C,D=C>>>13,P=0|o[8],I=8191&P,z=P>>>13,F=0|o[9],N=8191&F,B=F>>>13,j=0|s[0],U=8191&j,H=j>>>13,V=0|s[1],Y=8191&V,G=V>>>13,W=0|s[2],q=8191&W,X=W>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,vt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(h,U)|0))<<13)|0;u=((a=Math.imul(h,H))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,H))+Math.imul(v,U)|0,a=Math.imul(v,H);var mt=(u+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),i=(i=Math.imul(m,H))+Math.imul(y,U)|0,a=Math.imul(y,H),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,G)|0;var yt=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,q)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,H))+Math.imul(_,U)|0,a=Math.imul(_,H),n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,q)|0,a=a+Math.imul(v,X)|0;var xt=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;u=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,H))+Math.imul(T,U)|0,a=Math.imul(T,H),n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,K)|0;var bt=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,H))+Math.imul(L,U)|0,a=Math.imul(L,H),n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(T,Y)|0,a=a+Math.imul(T,G)|0,n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,H))+Math.imul(O,U)|0,a=Math.imul(O,H),n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(L,Y)|0,a=a+Math.imul(L,G)|0,n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(T,q)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0;var wt=(u+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;u=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,H))+Math.imul(D,U)|0,a=Math.imul(D,H),n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(L,q)|0,a=a+Math.imul(L,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0;var Mt=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((a=a+Math.imul(h,ut)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,H))+Math.imul(z,U)|0,a=Math.imul(z,H),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(O,q)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,K)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(m,at)|0,i=(i=i+Math.imul(m,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ut)|0;var Tt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,H))+Math.imul(B,U)|0,a=Math.imul(B,H),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(D,q)|0,a=a+Math.imul(D,X)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,K)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(L,$)|0,a=a+Math.imul(L,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(T,rt)|0,a=a+Math.imul(T,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(v,ft)|0,a=a+Math.imul(v,ht)|0;var At=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,vt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((a=a+Math.imul(h,vt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,Y),i=(i=Math.imul(N,G))+Math.imul(B,Y)|0,a=Math.imul(B,G),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(z,q)|0,a=a+Math.imul(z,X)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,K)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(L,rt)|0,a=a+Math.imul(L,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(T,at)|0,a=a+Math.imul(T,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ut)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((a=a+Math.imul(v,vt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,X))+Math.imul(B,q)|0,a=Math.imul(B,X),n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(z,J)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(L,at)|0,a=a+Math.imul(L,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(T,lt)|0,a=a+Math.imul(T,ut)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var Lt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,vt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((a=a+Math.imul(y,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,K))+Math.imul(B,J)|0,a=Math.imul(B,K),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(D,rt)|0,a=a+Math.imul(D,nt)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ot)|0)+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(L,lt)|0,a=a+Math.imul(L,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(T,ft)|0,a=a+Math.imul(T,ht)|0;var St=(u+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,vt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((a=a+Math.imul(_,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,tt))+Math.imul(B,$)|0,a=Math.imul(B,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ot)|0)+Math.imul(D,at)|0,a=a+Math.imul(D,ot)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ut)|0)+Math.imul(O,lt)|0,a=a+Math.imul(O,ut)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(L,ft)|0,a=a+Math.imul(L,ht)|0;var Et=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,vt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((a=a+Math.imul(T,vt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(B,rt)|0,a=Math.imul(B,nt),n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(D,lt)|0,a=a+Math.imul(D,ut)|0,n=n+Math.imul(E,ft)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(O,ft)|0,a=a+Math.imul(O,ht)|0;var Ot=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,vt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((a=a+Math.imul(L,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(N,at),i=(i=Math.imul(N,ot))+Math.imul(B,at)|0,a=Math.imul(B,ot),n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ut)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(D,ft)|0,a=a+Math.imul(D,ht)|0;var Ct=(u+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,vt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((a=a+Math.imul(O,vt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,lt),i=(i=Math.imul(N,ut))+Math.imul(B,lt)|0,a=Math.imul(B,ut),n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(z,ft)|0,a=a+Math.imul(z,ht)|0;var Rt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(D,pt)|0))<<13)|0;u=((a=a+Math.imul(D,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ht))+Math.imul(B,ft)|0,a=Math.imul(B,ht);var Dt=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,vt)|0)+Math.imul(z,pt)|0))<<13)|0;u=((a=a+Math.imul(z,vt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var Pt=(u+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,vt))+Math.imul(B,pt)|0))<<13)|0;return u=((a=Math.imul(B,vt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=mt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=Tt,l[9]=At,l[10]=kt,l[11]=Lt,l[12]=St,l[13]=Et,l[14]=Ot,l[15]=Ct,l[16]=Rt,l[17]=Dt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};function v(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):v(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new M(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(x,y),x.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new b;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var v=d,g=0;0!==v.cmp(s);g++)v=v.redSqr();n(g=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new T(t)},i(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6204:function(t){"use strict";t.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(c<=0)){var f,h=i.mallocDouble(2*c*s),d=i.mallocInt32(s);if((s=l(t,c,h,d))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,h,d,0,s,h,d);else{var p=i.mallocDouble(2*c*u),v=i.mallocInt32(u);(u=l(e,c,p,v))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,h,d,0,u,p,v):o(c,r,n,s,h,d,u,p,v),i.free(p),i.free(v))}i.free(h),i.free(d)}return f}}}function c(t,e){n.push([t,e])}},2455:function(t,e){"use strict";function r(t){return t?function(t,e,r,n,i,a,o,s,l,u,c){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,u,c){for(var f=2*t,h=n,d=f*n;hu-l?n?function(t,e,r,n,i,a,o,s,l,u,c){for(var f=2*t,h=n,d=f*n;h0;){var P=(R-=1)*b,I=w[P],z=w[P+1],F=w[P+2],N=w[P+3],B=w[P+4],j=w[P+5],U=R*_,H=M[U],V=M[U+1],Y=1&j,G=!!(16&j),W=c,q=L,X=E,Z=O;if(Y&&(W=E,q=O,X=c,Z=L),!(2&j&&z>=(F=g(t,I,z,F,W,q,V))||4&j&&(z=m(t,I,z,F,W,q,H))>=F)){var J=F-z,K=B-N;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)"),v=c("lo===p0"),g=c("lo>>1,h=2*t,d=f,p=s[h*f+e];u=x?(d=y,p=x):m>=_?(d=g,p=m):(d=b,p=_):x>=_?(d=y,p=x):_>=m?(d=g,p=m):(d=b,p=_);for(var w=h*(c-1),M=h*d,T=0;Tr&&i[f+e]>u;--c,f-=o){for(var h=f,d=f+o,p=0;ph;++h,l+=s)if(i[l+f]===o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=i[l+d];i[l+d]=i[u],i[u++]=p}var v=a[h];a[h]=a[c],a[c++]=v}return c},"loh;++h,l+=s)if(i[l+f]d;++d){var p=i[l+d];i[l+d]=i[u],i[u++]=p}var v=a[h];a[h]=a[c],a[c++]=v}return c},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s)if(i[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=i[l+d];i[l+d]=i[u],i[u++]=p}var v=a[h];a[h]=a[c],a[c++]=v}return c},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,f=t+e,h=r;n>h;++h,l+=s)if(i[l+f]<=o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var p=i[l+d];i[l+d]=i[u],i[u++]=p}var v=a[h];a[h]=a[c],a[c++]=v}return c},"lod;++d,l+=s){var p=i[l+f],v=i[l+h];if(pg;++g){var m=i[l+g];i[l+g]=i[u],i[u++]=m}var y=a[d];a[d]=a[c],a[c++]=y}}return c},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,u=l,c=r,f=e,h=t+e,d=r;n>d;++d,l+=s){var p=i[l+f],v=i[l+h];if(p<=o&&o<=v)if(c===d)c+=1,u+=s;else{for(var g=0;s>g;++g){var m=i[l+g];i[l+g]=i[u],i[u++]=m}var y=a[d];a[d]=a[c],a[c++]=y}}return c},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,u=l*r,c=u,f=r,h=e,d=t+e,p=r;n>p;++p,u+=l){var v=i[u+h],g=i[u+d];if(!(v>=o||s>=g))if(f===p)f+=1,c+=l;else{for(var m=0;l>m;++m){var y=i[u+m];i[u+m]=i[c],i[c++]=y}var x=a[p];a[p]=a[f],a[f++]=x}}return f}}},1811:function(t){"use strict";t.exports=function(t,n){n<=4*e?r(0,n-1,t):u(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function l(t,e,r,n){var i=n[t*=2];return i>1,g=v-h,m=v+h,y=d,x=g,b=v,_=m,w=p,M=t+1,T=c-1,A=0;s(y,x,f)&&(A=y,y=x,x=A),s(_,w,f)&&(A=_,_=w,w=A),s(y,b,f)&&(A=y,y=b,b=A),s(x,b,f)&&(A=x,x=b,b=A),s(y,_,f)&&(A=y,y=_,_=A),s(b,_,f)&&(A=b,b=_,_=A),s(x,w,f)&&(A=x,x=w,w=A),s(x,b,f)&&(A=x,x=b,b=A),s(_,w,f)&&(A=_,_=w,w=A);for(var k=f[2*x],L=f[2*x+1],S=f[2*_],E=f[2*_+1],O=2*y,C=2*b,R=2*w,D=2*d,P=2*v,I=2*p,z=0;z<2;++z){var F=f[O+z],N=f[C+z],B=f[R+z];f[D+z]=F,f[P+z]=N,f[I+z]=B}i(g,t,f),i(m,c,f);for(var j=M;j<=T;++j)if(l(j,k,L,f))j!==M&&n(j,M,f),++M;else if(!l(j,S,E,f))for(;;){if(l(T,S,E,f)){l(T,k,L,f)?(a(j,M,T,f),++M,--T):(n(j,T,f),--T);break}if(--T>>1;a(p,L);var S=0,E=0;for(M=0;M=o)v(c,f,E--,O=O-o|0);else if(O>=0)v(l,u,S--,O);else if(O<=-o){O=-O-o|0;for(var C=0;C>>1;a(p,S);var E=0,O=0,C=0;for(T=0;T>1==p[2*T+3]>>1&&(D=2,T+=1),R<0){for(var P=-(R>>1)-1,I=0;I>1)-1,0===D?v(l,u,E--,P):1===D?v(c,f,O--,P):2===D&&v(h,d,C--,P)}},scanBipartite:function(t,e,r,n,i,s,c,f,h,d,m,y){var x=0,b=2*t,_=e,w=e+t,M=1,T=1;n?T=o:M=o;for(var A=i;A>>1;a(p,E);var O=0;for(A=0;A=o?(R=!n,k-=o):(R=!!n,k-=1),R)g(l,u,O++,k);else{var D=y[k],P=b*k,I=m[P+e+1],z=m[P+e+1+t];t:for(var F=0;F>>1;a(p,M);var T=0;for(x=0;x=o)l[T++]=b-o;else{var k=d[b-=1],L=g*b,S=h[L+e+1],E=h[L+e+1+t];t:for(var O=0;O=0;--O)if(l[O]===b){for(P=O+1;P0;){for(var d=r.pop(),p=(c=-1,f=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),i(t,e,r,c,s,f),i(t,e,r,s,f,c),i(t,e,r,f,d,c),i(t,e,r,d,c,f))}}},5023:function(t,e,r){"use strict";var n,i=r(2478);function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i,c[d];for(var p=0;p<3;++p){var v=h[3*d+p];v>=0&&0===u[v]&&(f[3*d+p]?l.push(v):(s.push(v),u[v]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var m=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[d-2]],r[h[d-1]],a)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=f.upperIds;for(d=p.length;d>1&&i(r[p[d-2]],r[p[d-1]],a)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function c(t,e){var r;return(r=t.a[0]p[0]&&i.push(new o(p,d,2,l),new o(d,p,1,l))}i.sort(s);for(var v=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([v,1],[v,0],-1,[],[],[],[])],m=[],y=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[c=(L=n[a])[0]],b=x[0],_=x[1],w=t[b],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var T=b;b=_,_=T}x[0]=b;var A,k=x[1]=L[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===c;){var L,S=(L=n[--a])[1];i?e.push([k,S,A]):e.push([k,S]),k=S}i?e.push([k,_,A]):e.push([k,_])}return h}(t,e,h,v,r),y=p(t,g);return m(e,y,r),!!y||h.length>0||v.length>0}},3637:function(t,e,r){"use strict";t.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=c(a,f);if(0===o(h))return null;var d=c(f,s(t,r)),p=i(d,h),v=u(a,p);return l(t,v)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),u=r(8987);function c(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){"use strict";var n=r(3642),i=r(395);function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,u,c,f,h,d,p,v;if(t||(t={}),d=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>d+1)throw new Error(f+" map requires nshades to be at least size "+c.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=c.map((function(t){return Math.round(t.index*d)})),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var g=c.map((function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=p[0]+(p[1]-p[0])*r),n})),m=[];for(v=0;v0||l(t,e,a)?-1:1:0===s?u>0||l(t,e,r)?1:-1:i(u-s)}var f=n(t,e,r);return f>0?o>0&&n(t,e,a)>0?1:-1:f<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),u=a(r[1],-e[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},8572:function(t){"use strict";t.exports=function(t){return t<0?-1:t>0?1:0}},8507:function(t){t.exports=function(t,n){var i=t.length,a=t.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var o=t[0]+t[1],s=n[0]+n[1];if(a=o+t[2]-(s+n[2]))return a;var l=e(t[0],t[1]),u=e(n[0],n[1]);return e(l,t[2])-e(u,n[2])||e(l+t[2],o)-e(u+n[2],s);case 4:var c=t[0],f=t[1],h=t[2],d=t[3],p=n[0],v=n[1],g=n[2],m=n[3];return c+f+h+d-(p+v+g+m)||e(c,f,h,d)-e(p,v,g,m,p)||e(c+f,c+h,c+d,f+h,f+d,h+d)-e(p+v,p+g,p+m,v+g,v+m,g+m)||e(c+f+h,c+f+d,c+h+d,f+h+d)-e(p+v+g,p+v+m,p+g+m,v+g+m);default:for(var y=t.slice().sort(r),x=n.slice().sort(r),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},4750:function(t,e,r){"use strict";t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(t){"use strict";t.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+f*r[d]+h*n[d];return a}return u*t+c*e+f*r+h*n},t.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}},7642:function(t,e,r){"use strict";var n=r(8954),i=r(1682);function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=m[t[e]];if(r<0)return!1;t[e]=r}return!0})),1&s)for(c=0;c<_.length;++c)h=(b=_[c])[0],b[0]=b[1],b[1]=h;return _}},2361:function(t){var e=!1;if("undefined"!=typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);r[0]=1,e=!0,1072693248===n[1]?(t.exports=function(t){return r[0]=t,[n[0],n[1]]},t.exports.pack=function(t,e){return n[0]=t,n[1]=e,r[0]},t.exports.lo=function(t){return r[0]=t,n[0]},t.exports.hi=function(t){return r[0]=t,n[1]}):1072693248===n[0]?(t.exports=function(t){return r[0]=t,[n[1],n[0]]},t.exports.pack=function(t,e){return n[1]=t,n[0]=e,r[0]},t.exports.lo=function(t){return r[0]=t,n[1]},t.exports.hi=function(t){return r[0]=t,n[0]}):e=!1}if(!e){var i=new Buffer(8);t.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},t.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},t.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},t.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}t.exports.sign=function(e){return t.exports.hi(e)>>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},1338:function(t){"use strict";function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var c=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],u[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=a(u[h-1],c[h-1],arguments[h]);n.push(d),i.push((d-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];n.push(a(l[h-1],u[h-1],n[o++]+d)),i.push(d*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},3840:function(t){"use strict";function e(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function a(t,e){this._compare=t,this.root=e}t.exports=function(t){return new a(t||d,null)};var o=a.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function u(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=u(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(t,e,r,n,i.right)}function c(t,e){this.tree=t,this._stack=e}Object.defineProperty(o,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(o,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(t,r){for(var o=this._compare,s=this.root,l=[],u=[];s;){var c=o(t,s.key);l.push(s),u.push(c),s=c<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var f=l.length-2;f>=0;--f)s=l[f],u[f]<=0?l[f]=new e(s._color,s.key,s.value,l[f+1],s.right,s._count+1):l[f]=new e(s._color,s.key,s.value,s.left,l[f+1],s._count+1);for(f=l.length-1;f>1;--f){var h=l[f-1];if(s=l[f],1===h._color||1===s._color)break;var d=l[f-2];if(d.left===h)if(h.left===s){if(!(p=d.right)||0!==p._color){d._color=0,d.left=h.right,h._color=1,h.right=d,l[f-2]=h,l[f-1]=s,i(d),i(h),f>=3&&((v=l[f-3]).left===d?v.left=h:v.right=h);break}h._color=1,d.right=n(1,p),d._color=0,f-=1}else{if(!(p=d.right)||0!==p._color){h.right=s.left,d._color=0,d.left=s.right,s._color=1,s.left=h,s.right=d,l[f-2]=s,l[f-1]=h,i(d),i(h),i(s),f>=3&&((v=l[f-3]).left===d?v.left=s:v.right=s);break}h._color=1,d.right=n(1,p),d._color=0,f-=1}else if(h.right===s){if(!(p=d.left)||0!==p._color){d._color=0,d.right=h.left,h._color=1,h.left=d,l[f-2]=h,l[f-1]=s,i(d),i(h),f>=3&&((v=l[f-3]).right===d?v.right=h:v.left=h);break}h._color=1,d.left=n(1,p),d._color=0,f-=1}else{var p;if(!(p=d.left)||0!==p._color){var v;h.left=s.right,d._color=0,d.right=s.left,s._color=1,s.right=h,s.left=d,l[f-2]=s,l[f-1]=h,i(d),i(h),i(s),f>=3&&((v=l[f-3]).right===d?v.right=s:v.left=s);break}h._color=1,d.left=n(1,p),d._color=0,f-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return u(e,r,this._compare,t,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new c(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new c(this,t)}}),o.at=function(t){if(t<0)return new c(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new c(this,[])},o.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new c(this,n)},o.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new c(this,n)},o.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new c(this,n);r=i<=0?r.left:r.right}return new c(this,[])},o.remove=function(t){var e=this.find(t);return e?e.remove():this},o.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var f=c.prototype;function h(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t,e){return te?1:0}Object.defineProperty(f,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(f,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),f.clone=function(){return new c(this.tree,this._stack.slice())},f.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var o=new Array(t.length),s=t[t.length-1];o[o.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?o[l]=new e(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var u=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var c=o[u-1];for(o.push(new e(s._color,c.key,c.value,s.left,s.right,s._count)),o[u-1].key=s.key,o[u-1].value=s.value,l=o.length-2;l>=u;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[u-1].left=o[u]}if(0===(s=o[o.length-1])._color){var f=o[o.length-2];for(f.left===s?f.left=null:f.right===s&&(f.right=null),o.pop(),l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((a=t[l-1]).left===e){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((u=t[l-2]).left===a?u.left=o:u.right=o),void(t[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((u=t[l-2]).left===a?u.left=s:u.right=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=t[l-2]).left===a?u.left=o:u.right=o),t[l-1]=o,t[l]=a,l+11&&((u=t[l-2]).right===a?u.right=o:u.left=o),void(t[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((u=t[l-2]).right===a?u.right=s:u.left=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var u;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((u=t[l-2]).right===a?u.right=o:u.left=o),t[l-1]=o,t[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(f,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(f,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),f.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),f.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new e(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new e(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},f.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},3837:function(t,e,r){"use strict";t.exports=function(t,e){var r=new d(t);return r.update(e),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=ArrayBuffer,c=DataView;function f(t){return Array.isArray(t)||function(t){return u.isView(t)&&!(t instanceof c)}(t)}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function d(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var p=d.prototype;function v(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?f(a)&&f(a[0]):f(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),u=e.bind(this,!0,(function(t){if(f(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),c=!1,h=!1;if("bounds"in t)for(var d=t.bounds,p=0;p<2;++p)for(var v=0;v<3;++v)d[p][v]!==this.bounds[p][v]&&(h=!0),this.bounds[p][v]=d[p][v];if("ticks"in t)for(r=t.ticks,c=!0,this.autoTicks=!1,p=0;p<3;++p)this.tickSpacing[p]=0;else a("tickSpacing")&&(this.autoTicks=!0,h=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),h=!0,c=!0,this._firstInit=!1),h&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(p=0;p<3;++p)r[p].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),l("tickFontStyle")&&(c=!0),l("tickFontWeight")&&(c=!0),l("tickFontVariant")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),u("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),u("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),u("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),u("lineTickColor"),o("gridEnable"),a("gridWidth"),u("gridColor"),o("zeroEnable"),u("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),u("backgroundColor");var m=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],y=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||c)&&this._text.update(this.bounds,this.labels,m,this.ticks,y):this._text=n(this.gl,this.bounds,this.labels,m,this.ticks,y),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new v,new v,new v];function m(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var f=a,h=s,d=o,p=l;u&1<0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}var y=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var b=[0,0,0],_=[0,0,0],w=[0,0,0];p.draw=function(t){t=t||x;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),c=u.cubeEdges,f=u.axis,d=n[12],p=n[13],v=n[14],M=n[15],T=(s?2:1)*this.pixelRatio*(i[3]*d+i[7]*p+i[11]*v+i[15]*M)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=c[A],this.lastCubeProps.axis[A]=f[A];var k=g;for(A=0;A<3;++A)m(g[A],A,this.bounds,c,f);e=this.gl;var L,S,E,O=y;for(A=0;A<3;++A)this.backgroundEnable[A]?O[A]=f[A]:O[A]=0;for(this._background.draw(r,n,i,a,O,this.backgroundColor),this._lines.bind(r,n,i,this),A=0;A<3;++A){var C=[0,0,0];f[A]>0?C[A]=a[1][A]:C[A]=a[0][A];for(var R=0;R<2;++R){var D=(A+1+R)%3,P=(A+1+(1^R))%3;this.gridEnable[D]&&this._lines.drawGrid(D,P,this.bounds,C,this.gridColor[D],this.gridWidth[D]*this.pixelRatio)}for(R=0;R<2;++R)D=(A+1+R)%3,P=(A+1+(1^R))%3,this.zeroEnable[P]&&Math.min(a[0][P],a[1][P])<=0&&Math.max(a[0][P],a[1][P])>=0&&this._lines.drawZero(D,P,this.bounds,C,this.zeroLineColor[P],this.zeroLineWidth[P]*this.pixelRatio)}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,k[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var I=h(b,k[A].primalMinor),z=h(_,k[A].mirrorMinor),F=this.lineTickLength;for(R=0;R<3;++R){var N=T/r[5*R];I[R]*=F[R]*N,z[R]*=F[R]*N}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,k[A].primalOffset,I,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,k[A].mirrorOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}function B(t){(E=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?B(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&B(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),A=0;A<3;++A){var U=k[A].primalMinor,H=k[A].mirrorMinor,V=h(w,k[A].primalOffset);for(R=0;R<3;++R)this.lineTickEnable[A]&&(V[R]+=T*U[R]*Math.max(this.lineTickLength[R],0)/r[5*R]);var Y=[0,0,0];if(Y[A]=1,this.tickEnable[A]){for(-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,S=1,"auto"===(L=[this.tickAlign[A],.5,S])[0]?L[0]=0:L[0]=parseInt(""+L[0]),E=[0,0,0],j(A,U,H),R=0;R<3;++R)V[R]+=T*U[R]*this.tickPad[R]/r[5*R];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],V,this.tickColor[A],Y,E,L)}if(this.labelEnable[A]){for(S=0,E=[0,0,0],this.labels[A].length>4&&(B(A),S=1),"auto"===(L=[this.labelAlign[A],.5,S])[0]?L[0]=0:L[0]=parseInt(""+L[0]),R=0;R<3;++R)V[R]+=T*U[R]*this.labelPad[R]/r[5*R];V[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],V,this.labelColor[A],[0,0,0],E,L)}}this._text.unbind()},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(t,e,r){"use strict";t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[u]=p;for(var v=-1;v<=1;v+=2)f[c]=v,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=u;u=c,c=g}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,m,x,b)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(t,e,r){"use strict";t.exports=function(t,e,r,a,d){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){c[2]=a[x][2];for(var b=0;b<2;++b){c[1]=a[b][1];for(var _=0;_<2;++_)c[0]=a[_][0],h(l[y],c,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var M=l[x][3],T=0;T<3;++T)u[x][T]=l[x][T]/M;d&&(u[x][2]*=-1),M<0&&(w<0||u[x][2]S&&(w|=1<S&&(w|=1<u[x][1])&&(z=x);var F=-1;for(x=0;x<3;++x)(B=z^1<u[N][0]&&(N=B))}var j=v;j[0]=j[1]=j[2]=0,j[n.log2(F^z)]=z&F,j[n.log2(z^N)]=z&N;var U=7^N;U===w||U===I?(U=7^F,j[n.log2(N^U)]=U&N):j[n.log2(F^U)]=U&F;var H=g,V=w;for(A=0;A<3;++A)H[A]=V&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.Q=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){"use strict";t.exports=function(t,e,r,n,o,l){var u=i(t),f=a(t,[{buffer:u,size:3}]),h=s(t);h.attributes.position.location=0;var d=new c(t,h,u,f);return d.update(e,r,n,o,l),d};var i=r(2762),a=r(8116),o=r(4359),s=r(1879).Q,l=window||n.global||{},u=l.__TEXT_CACHE||{};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var f=c.prototype,h=[0,0];f.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},f.unbind=function(){this.vao.unbind()},f.update=function(t,e,r,n,i){var a=[];function s(t,e,r,n,i,s){var l=[r.style,r.weight,r.variant,r.family].join("_"),c=u[l];c||(c=u[l]={});var f=c[e];f||(f=c[e]=function(t,e){try{return o(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var h=(n||12)/12,d=f.positions,p=f.cells,v=0,g=p.length;v=0;--y){var x=d[m[y]];a.push(h*x[0],-h*x[1],t)}}for(var l=[0,0,0],c=[0,0,0],f=[0,0,0],h=[0,0,0],d={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},p=0;p<3;++p){f[p]=a.length/3|0,s(.5*(t[0][p]+t[1][p]),e[p],r[p],12,1.25,d),h[p]=(a.length/3|0)-f[p],l[p]=a.length/3|0;for(var v=0;v=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=t[0][i];--o)a.push({x:o*e[i],text:r(e[i],o)});n.push(a)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function c(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},6405:function(t,e,r){"use strict";var n=r(2931);t.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,f=1/0,h=-1/0,d=null,p=null,v=[],g=1/0,m=!1,y="raw"===t.coneSizemode,x=0;xo&&(o=n.length(_)),x&&!y){var w=2*n.distance(d,b)/(n.length(p)+n.length(_));w?(g=Math.min(g,w),m=!1):m=!0}m||(d=b,p=_),v.push(_)}var M=[s,u,f],T=[l,c,h];e&&(e[0]=M,e[1]=T),0===o&&(o=1);var A=1/o;isFinite(g)||(g=1),a.vectorScale=g;var k=t.coneSize||(y?1:.5);t.absoluteConeSize&&(k=t.absoluteConeSize*A),a.coneScale=k,x=0;for(var L=0;x=1},d.isTransparent=function(){return this.opacity<1},d.pickSlots=1,d.setPickBase=function(t){this.pickId=t},d.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=c({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return u(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var h=t.meshColor||[1,1,1,1],d=t.vertexIntensity,p=1/0,v=-1/0;if(d)if(t.vertexIntensityBounds)p=+t.vertexIntensityBounds[0],v=+t.vertexIntensityBounds[1];else for(var g=0;g0){var v=this.triShader;v.bind(),v.uniforms=u,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},d.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},d.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},d.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),c=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),f=o(t,u(new Uint8Array([255,255,255,255]),[1,1,4]));f.generateMipmap(),f.minFilter=t.LINEAR_MIPMAP_LINEAR,f.magFilter=t.LINEAR;var d=i(t),p=i(t),v=i(t),g=i(t),m=i(t),y=new h(t,f,l,c,d,p,m,v,g,a(t,[{buffer:d,type:t.FLOAT,size:4},{buffer:m,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:v,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),r.traceType||"cone");return y.update(e),y}},614:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var n=r(737);t.exports=function(t){return n[t]}},9165:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*c,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=c[n],a=0;a0&&((d=c.slice())[s]+=p[1][s],i.push(c[0],c[1],c[2],v[0],v[1],v[2],v[3],0,0,0,d[0],d[1],d[2],v[0],v[1],v[2],v[3],0,0,0),u(this.bounds,d),o+=2+f(i,d,v,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(t,e,r){"use strict";var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){"use strict";var n=r(7766);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var v=!0;"depth"in n&&(v=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new p(t,e,r,h,f,v,g,u)};var i,a,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function p(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):v&&p?t._depth_rb=d(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):v?t._depth_rb=d(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),m=0;mi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=u(n),o=0;o>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var v=i.attributes;return this.positionBuffer.bind(),v.position.pointer(),this.weightBuffer.bind(),v.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),v.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var u,c,f,d,p=t.colorLevels||[0],v=t.colorValues||[0,0,0,1],g=p.length,m=this.bounds;l?(u=m[0]=r[0],c=m[1]=o[0],f=m[2]=r[r.length-1],d=m[3]=o[o.length-1]):(u=m[0]=r[0]+(r[1]-r[0])/2,c=m[1]=o[0]+(o[1]-o[0])/2,f=m[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,d=m[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-u),x=1/(d-c),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(h.length>>>1);this.numVertices=w;for(var M=a.mallocUint8(4*w),T=a.mallocFloat32(2*w),A=a.mallocUint8(2*w),k=a.mallocUint32(w),L=0,S=l?b-1:b,E=l?_-1:_,O=0;O max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,a,o,null,l)},e.createPickShader=function(t){return i(t,a,s,null,l)}},5714:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(new Array(1024),[256,1,4]),d=0;d<1024;++d)c.data[d]=255;var p=a(e,c);p.wrap=e.REPEAT;var v=new m(e,r,o,s,l,p);return v.update(t),v};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),u=r(9618),c=r(7319),f=c.createShader,h=c.createPickShader,d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function v(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function m(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=m.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,clipBounds:v(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||d,view:t.view||d,projection:t.projection||d,pickId:this.pickId,clipBounds:v(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var d=t.color||t.colors||[0,0,0,1],v=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=2,g=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(d[0])?(m=d.length>e-1?d[e-1]:d.length>0?d[d.length-1]:[0,0,0,1],y=d.length>e?d[e]:d.length>0?d[d.length-1]:[0,0,0,1]):m=y=d,3===m.length&&(m=[m[0],m[1],m[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0),x=Array.isArray(v)?v.length>e-1?v[e-1]:v.length>0?v[v.length-1]:[0,0,0,1]:v;var M=s;if(s+=p(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],M,x,m[0],m[1],m[2],m[3]);c+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],M,x,m[0],m[1],m[2],m[3],b[0],b[1],b[2],_[0],_[1],_[2],M,-x,m[0],m[1],m[2],m[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(i),a.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in t){var T=t.dashes.slice();for(T.unshift(0),e=1;e1.0001)return null;m+=g[f]}return Math.abs(m-1)>.001?null:[h,s(t,g),g]}},840:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:d,fragment:p,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){"use strict";var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),u=r(7608),c=r(9618),f=r(6729),h=r(7765),d=r(1888),p=r(840),v=r(7626),g=p.meshShader,m=p.wireShader,y=p.pointShader,x=p.pickShader,b=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function M(t,e,r,n,i,a,o,s,l,u,c,f,h,d,p,v,g,m,y,x,b,_,M,T,A,k,L){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=m,this.edgeIds=v,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=M,this.pointSizes=T,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=L,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=M.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function k(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function S(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function E(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(t){this.pickId=t},T.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;ai[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t],r.uniforms.angle=m[t],a.drawArrays(a.TRIANGLES,i[T],i[A]-i[T]))),y[t]&&M&&(c[1^t]-=k*d*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,M)),c[1^t]=k*s[2+(1^t)]-1,p[t+2]&&(c[1^t]+=k*d*v[t+2],Ti[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=g[t+2],r.uniforms.angle=m[t+2],a.drawArrays(a.TRIANGLES,i[T],i[A]-i[T]))),y[t+2]&&M&&(c[1^t]+=k*d*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,M))}),v.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),v.bind=(h=[0,0],d=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,u=.5*(n[o+2]+n[o]),c=n[o+2]-n[o],f=a[o],v=a[o+2]-f,g=i[o],m=i[o+2]-g;d[o]=2*l/c*v/m,h[o]=2*(s-u)/c*v/m}p[1]=2*t.pixelRatio/(i[3]-i[1]),p[0]=p[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=d,e.uniforms.dataShift=h,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),v.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var v=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(v,e[1],v,e[3],d[p],h[p]):o.drawLine(e[0],v,e[2],v,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();for(this.objects.length=0,t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},u.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else if(!p._ortho){var o=-p.zoomSpeed*i*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},p.enableMouseListeners(),p};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){"use strict";var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),u=r(7169),c=r(351),f=r(4772),h=r(4040),d=r(799),p=r(9216)({tablet:!0,featureDetect:!0});function v(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function m(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(p=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:p})),!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new v,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!p}),_=d(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,M={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},T=t.axes||{},A=i(r,T);A.enable=!T.disable;var k=t.spikes||{},L=o(r,k),S=[],E=[],O=[],C=[],R=!0,D=!0,P={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},I=(D=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),z=t.cameraObject||n(e,M),F={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:z,axes:A,axesPixels:null,spikes:L,bounds:y,objects:S,shape:I,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:m(t.autoResize),autoBounds:m(t.autoBounds),autoScale:!!t.autoScale,autoCenter:m(t.autoCenter),clipToBounds:m(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:P,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,D=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},N=[r.drawingBufferWidth/F.pixelRatio|0,r.drawingBufferHeight/F.pixelRatio|0];function B(){if(!F._stopped&&F.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*F.pixelRatio),a=0|Math.ceil(n*F.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",R=!0}}}function j(){for(var t=S.length,e=C.length,n=0;n0&&0===O[e-1];)O.pop(),C.pop().dispose()}function U(){if(F.contextLost)return!0;r.isContextLost()&&(F.contextLost=!0,F.mouseListener.enabled=!1,F.selection.object=null,F.oncontextloss&&F.oncontextloss())}F.autoResize&&B(),window.addEventListener("resize",B),F.update=function(t){F._stopped||(t=t||{},R=!0,D=!0)},F.add=function(t){F._stopped||(t.axes=A,S.push(t),E.push(-1),R=!0,D=!0,j())},F.remove=function(t){if(!F._stopped){var e=S.indexOf(t);e<0||(S.splice(e,1),E.pop(),R=!0,D=!0,j())}},F.dispose=function(){if(!F._stopped&&(F._stopped=!0,window.removeEventListener("resize",B),e.removeEventListener("webglcontextlost",U),F.mouseListener.enabled=!1,!F.contextLost)){A.dispose(),L.dispose();for(var t=0;tx.distance)continue;for(var u=0;u 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),e.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),e.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},4696:function(t,e,r){"use strict";var n=r(9405),i=r(2762),a=r(1888),o=r(6640);function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}t.exports=function(t,e){var r=t.gl,a=new s(t,i(r),i(r),n(r,o.pointVertex,o.pointFragment),n(r,o.pickVertex,o.pickFragment));return a.update(e),t.addObject(a),a};var l,u,c=s.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),u=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=c<5,r.uniforms.pointSize=c,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(u[0]=255&t,u[1]=t>>8&255,u[2]=t>>16&255,u[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=u,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},783:function(t){t.exports=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],f=e[2],h=e[3],d=r[0],p=r[1],v=r[2],g=r[3];return(a=u*d+c*p+f*v+h*g)<0&&(a=-a,d=-d,p=-p,v=-v,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*v,t[3]=s*h+l*g,t}},5964:function(t){"use strict";t.exports=function(t){return t||0===t?t.toString():""}},9366:function(t,e,r){"use strict";var n=r(4359);t.exports=function(t,e,r){var a=[e.style,e.weight,e.variant,e.family].join("_"),o=i[a];if(o||(o=i[a]={}),t in o)return o[t];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e.family,fontStyle:e.style,fontWeight:e.weight,fontVariant:e.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(t,s);s.triangles=!1;var u,c,f=n(t,s);if(r&&1!==r){for(u=0;u max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},v={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};function m(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return m(t,f)},e.createOrtho=function(t){return m(t,h)},e.createProject=function(t){return m(t,d)},e.createPickPerspective=function(t){return m(t,p)},e.createPickOrtho=function(t){return m(t,v)},e.createPickProject=function(t){return m(t,g)}},8418:function(t,e,r){"use strict";var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),u=r(9366),c=r(5964),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=ArrayBuffer,d=DataView;function p(t){return Array.isArray(t)||function(t){return h.isView(t)&&!(t instanceof d)}(t)}function v(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function g(t,e,r,n){return v(n,n),v(n,n),v(n,n)}function m(t,e){this.index=t,this.dataCoordinate=this.position=e}function y(t){return!0===t||t>1?1:t}function x(t,e,r,n,i,a,o,s,l,u,c,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new m(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),f=i(e),h=i(e),d=i(e),p=i(e),v=new x(e,r,n,o,f,h,d,p,a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),s,u,c);return v.update(t),v};var b=x.prototype;b.pickSlots=1,b.setPickBase=function(t){this.pickId=t},b.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},b.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var _=[0,0],w=[0,0,0],M=[0,0,0],T=[0,0,0,1],A=[0,0,0,1],k=f.slice(),L=[0,0,0],S=[[0,0,0],[0,0,0]];function E(t){return t[0]=t[1]=t[2]=0,t}function O(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function C(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}var R=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function D(t,e,r,n,i,a,o){var l=r.gl;if((a===r.projectHasAlpha||o)&&function(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||f,c=r.view||f,h=r.projection||f,d=e.axesBounds,p=function(t){for(var e=S,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],_[0]=2/o.drawingBufferWidth,_[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=h,l.screenSize=_,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=p,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var v=0;v<3;++v)if(a[v]){l.scale=e.projectScale[v],l.opacity=e.projectOpacity[v];for(var m=k,y=0;y<16;++y)m[y]=0;for(y=0;y<4;++y)m[5*y]=1;m[5*v]=0,i[v]<0?m[12+v]=d[0][v]:m[12+v]=d[1][v],s(m,u,m),l.model=m;var x=(v+1)%3,b=(v+2)%3,R=E(w),D=E(M);R[x]=1,D[b]=1;var P=g(0,0,0,O(T,R)),I=g(0,0,0,O(A,D));if(Math.abs(P[1])>Math.abs(I[1])){var z=P;P=I,I=z,z=R,R=D,D=z;var F=x;x=b,b=F}P[0]<0&&(R[x]=-1),I[1]>0&&(D[b]=-1);var N=0,B=0;for(y=0;y<4;++y)N+=Math.pow(u[4*x+y],2),B+=Math.pow(u[4*b+y],2);R[x]/=Math.sqrt(N),D[b]/=Math.sqrt(B),l.axes[0]=R,l.axes[1]=D,l.fragClipBounds[0]=C(L,p[0],v,-1e8),l.fragClipBounds[1]=C(L,p[1],v,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}(e,r,n,i),a===r.hasAlpha||o){t.bind();var u=t.uniforms;u.model=n.model||f,u.view=n.view||f,u.projection=n.projection||f,_[0]=2/l.drawingBufferWidth,_[1]=2/l.drawingBufferHeight,u.screenSize=_,u.highlightId=r.highlightId,u.highlightScale=r.highlightScale,u.fragClipBounds=R,u.clipBounds=r.axes.bounds,u.opacity=r.opacity,u.pickGroup=r.pickId/255,u.pixelRatio=i,r.vao.bind(),r.vao.draw(l.TRIANGLES,r.vertexCount),r.lineWidth>0&&(l.lineWidth(r.lineWidth*i),r.vao.draw(l.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function P(t,e,r,i){var a;a=p(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},b.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},b.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(p(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(p(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){p(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=y(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=y(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},u=t.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else for(i=[],a=[],n=0;n0){var D=0,I=b,z=[0,0,0,1],F=[0,0,0,1],N=p(d)&&p(d[0]),B=p(m)&&p(m[0]);t:for(n=0;n0?1-L[0][0]:q<0?1+L[1][0]:1,X*=X>0?1-L[0][1]:X<0?1+L[1][1]:1],J=A.cells||[],K=A.positions||[];for(T=0;T0){var m=r*c;o.drawBox(f-m,h-m,d+m,h+m,a),o.drawBox(f-m,p-m,d+m,p+m,a),o.drawBox(f-m,h-m,f+m,p+m,a),o.drawBox(d-m,h-m,d+m,p+m,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},3589:function(t,e,r){"use strict";t.exports=function(t,e){var r=e[0],a=e[1];return new l(t,n(t,r,a,{}),i.mallocUint8(r*a*4))};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var u=l.prototype;Object.defineProperty(u,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var M=0|w.type.charAt(w.type.length-1),T=new Array(M),A=0;A=0;)k+=1;_[y]=k}var L=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,b,_);for(var t=0;t=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d[0],i,p,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);l(t,e,d,i,p,a,f)}}}return a};var n=r(8866);function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var u=o[a],c=new i(t,e,r,n,a,u);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),u(t,n[r],e),e},get:function(){return c},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),u=new Array(i),c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+y);t["uniformMatrix"+m+"fv"](s[f],!1,h);break}throw new i("","Unknown uniform data type for "+name+": "+y)}if((m=y.charCodeAt(y.length-1)-48)<2||m>4)throw new i("","Invalid data type");switch(y.charAt(0)){case"b":case"i":t["uniform"+m+"iv"](s[f],h);break;case"v":t["uniform"+m+"fv"](s[f],h);break;default:throw new i("","Unrecognized data type for vector "+name+": "+y)}}}}}}function u(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function c(t,e,n){if("object"==typeof n){var u=f(n);Object.defineProperty(t,e,{get:a(u),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(c=n,function(t,e,r){return t.getUniform(e.program,r[c])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var c}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){"use strict";var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e){var r,n=t.length;for(r=0;re)return r-1}return r},s=function(t,e,r){return tr?r:t},l=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nf-1||y>h-1||x>d-1)return n.create();var b,_,w,M,T,A,k=a[0][p],L=a[0][m],S=a[1][v],E=a[1][y],O=a[2][g],C=(l-k)/(L-k),R=(u-S)/(E-S),D=(c-O)/(a[2][x]-O);switch(isFinite(C)||(C=.5),isFinite(R)||(R=.5),isFinite(D)||(D=.5),r.reversedX&&(p=f-1-p,m=f-1-m),r.reversedY&&(v=h-1-v,y=h-1-y),r.reversedZ&&(g=d-1-g,x=d-1-x),r.filled){case 5:T=g,A=x,w=v*d,M=y*d,b=p*d*h,_=m*d*h;break;case 4:T=g,A=x,b=p*d,_=m*d,w=v*d*f,M=y*d*f;break;case 3:w=v,M=y,T=g*h,A=x*h,b=p*h*d,_=m*h*d;break;case 2:w=v,M=y,b=p*h,_=m*h,T=g*h*f,A=x*h*f;break;case 1:b=p,_=m,T=g*f,A=x*f,w=v*f*d,M=y*f*d;break;default:b=p,_=m,w=v*f,M=y*f,T=g*f*h,A=x*f*h}var P=i[b+w+T],I=i[b+w+A],z=i[b+M+T],F=i[b+M+A],N=i[_+w+T],B=i[_+w+A],j=i[_+M+T],U=i[_+M+A],H=n.create(),V=n.create(),Y=n.create(),G=n.create();n.lerp(H,P,N,C),n.lerp(V,I,B,C),n.lerp(Y,z,j,C),n.lerp(G,F,U,C);var W=n.create(),q=n.create();n.lerp(W,H,Y,R),n.lerp(q,V,G,R);var X=n.create();return n.lerp(X,W,q,D),X}(e,t,d)},v=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=p(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=p(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=p(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],m=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],M=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},T=10*n.distance(e[0],e[1])/u,A=T*T,k=1,L=0,S=r.length;S>1&&(k=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,u=0;uL&&(L=F),I.push(F),g.push({points:C,velocities:R,divergences:I});for(var N=0;N<100*u&&C.lengthA&&n.scale(B,B,T/Math.sqrt(j)),n.add(B,B,O),D=p(B),n.squaredDistance(P,B)-A>-1e-4*A&&(C.push(B),P=B,R.push(D),z=v(B,D),F=n.length(z),isFinite(F)&&F>L&&(L=F),I.push(F)),O=B}}var U=function(t,e,r,a){for(var o=0,s=0;s0)for(M=0;M<8;M++){var T=(M+1)%8;u.push(h[M],d[M],d[T],d[T],h[T],h[M]),f.push(y,m,m,m,y,y),p.push(v,g,g,g,v,v);var A=u.length;c.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var k=h;h=d,d=k;var L=y;y=m,m=L;var S=v;v=g,g=S}return{positions:u,cells:c,vectors:f,vertexIntensity:p}}(t,r,a,o)})),f=[],h=[],d=[],p=[];for(s=0;s max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},9499:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),u=i(e),c=a(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),d=i(e),p=a(e,[{buffer:d,size:2,type:e.FLOAT}]),v=o(e,1,L,e.RGBA,e.UNSIGNED_BYTE);v.minFilter=e.LINEAR,v.magFilter=e.LINEAR;var g=new S(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,v,s,l,f,h,d,p,[0,0,0]),m={levels:[[],[],[]]};for(var M in t)m[M]=t[M];return m.colormap=m.colormap||"jet",g.update(m),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),u=r(5298),c=r(9994),f=r(9618),h=r(3711),d=r(6760),p=r(7608),v=r(2478),g=r(6199),m=r(990),y=m.createShader,x=m.createContourShader,b=m.createPickShader,_=m.createPickContourShader,w=40,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function k(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var L=256;function S(t,e,r,n,i,a,o,l,u,c,h,d,p,v,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new k([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=v,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var E=S.prototype;E.genColormap=function(t,e){var r=!1,n=c([l({colormap:t,nshades:L,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return u.divseq(n,255),this.hasAlphaScale=r,n},E.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},E.isOpaque=function(){return!this.isTransparent()},E.pickSlots=1,E.setPickBase=function(t){this.pickId=t};var O=[0,0,0],C={showSurface:!1,showContour:!1,projections:[M.slice(),M.slice(),M.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function R(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||O,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=C.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],d(l,t.model,l);var u=C.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return C.showSurface=o,C.showContour=s,C}var D={model:M,view:M,projection:M,inverseModel:M.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},P=M.slice(),I=[1,0,0,0,1,0,0,0,1];function z(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=D;n.model=t.model||M,n.view=t.view||M,n.projection=t.projection||M,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=I,n.vertexColor=this.vertexColor;var s=P;for(d(s,n.view,n.model),d(s,n.projection,s),p(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=R(n,this);if(c.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,h=0;h<2;++h)for(var d=i+c,p=s+h,g=f*(h?l:1-l),m=0;m<3;++m)u[m]+=this._field[m].get(d,p)*g;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=v.le(this.contourLevels[x],u[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-u[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],m=0;m<3;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},E.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},E.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=N(t.contourWidth,Number)),"showContour"in t&&(this.showContour=N(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=N(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=j(t.contourColor)),"contourProject"in t&&(this.contourProject=N(t.contourProject,(function(t){return N(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=j(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=N(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=N(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(m=0;m<2;++m)if(u.shape[m]!==a[m])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(t.ticks){var c=t.ticks;if(!Array.isArray(c)||2!==c.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var d=c[o];if((Array.isArray(d)||d.length)&&(d=f(d)),d.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var p=f(d.data,a);p.stride[o]=d.stride[0],p.stride[1^o]=0,this.padField(this._field[o],p)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var m=0;m0){for(var xt=0;xt<5;++xt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var bt=s.mallocFloat(Q.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=p(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var f,d,g=0;if(2===o.length)g=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)f=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];d=a.malloc(m,r);var x=n(d,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?i.assign(x,e):c(x,e),f=d.subarray(0,m)}var b=v(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,u,f),l||a.free(d),new h(t,b,o[0],o[1],g,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var c=function(t,e){i.muls(t,e,255)};function f(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=h.prototype;function p(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function v(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),d.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,f){var h=f.dtype,d=f.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var v=0,g=0,m=p(d,f.stride.slice());if("float32"===h?v=t.FLOAT:"float64"===h?(v=t.FLOAT,m=!1,h="float32"):"uint8"===h?v=t.UNSIGNED_BYTE:(v=t.UNSIGNED_BYTE,m=!1,h="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],f=n(f.data,d,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])g=t.ALPHA;else if(2===d[2])g=t.LUMINANCE_ALPHA;else if(3===d[2])g=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}d[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,x=u.indexOf(o)<0;if(x&&u.push(o),v===l&&m)0===f.offset&&f.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data):x?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,d,[d[2],d[2]*d[0],1]);v===t.FLOAT&&l===t.UNSIGNED_BYTE?c(_,f):i.assign(_,f),x?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},1433:function(t){"use strict";t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},3126:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},3990:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},1091:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},244:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},2681:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},5137:function(t,e,r){t.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},7636:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},6894:function(t){t.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=i+o*u-s*l,t[2]=a+o*l+s*u,t}},109:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+s*l+o*u,t[1]=e[1],t[2]=a+s*u-o*l,t}},8692:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+o*u-s*l,t[1]=a+o*l+s*u,t[2]=e[2],t}},2447:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},6621:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},8489:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},1463:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},3066:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},492:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},5673:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},264:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t}},4361:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},2335:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},2933:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},7536:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},3750:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},3390:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},6808:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},2573:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},160:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2334:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},3576:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},1498:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},5177:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},9131:function(t,e,r){var n=r(5177),i=r(9288);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},9288:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4844:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},4578:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},7960:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},483:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},6860:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},5352:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},4041:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t[3]=e[3],t}},1848:function(t,e,r){var n=r(4905),i=r(6468);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return B(r),C+=r.length,(L=L.slice(r.length)).length}}function W(){return/[^a-fA-F0-9]/.test(e)?(B(L.join("")),k=l,T):(L.push(e),r=e,T+1)}function q(){return"."===e||/[eE]/.test(e)?(L.push(e),k=v,r=e,T+1):"x"===e&&1===L.length&&"0"===L[0]?(k=_,L.push(e),r=e,T+1):/[^\d]/.test(e)?(B(L.join("")),k=l,T):(L.push(e),r=e,T+1)}function X(){return"f"===e&&(L.push(e),r=e,T+=1),/[eE]/.test(e)?(L.push(e),r=e,T+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(B(L.join("")),k=l,T):(L.push(e),r=e,T+1)}function Z(){if(/[^\d\w_]/.test(e)){var t=L.join("");return k=N[t]?y:F[t]?m:g,B(L.join("")),k=l,T}return L.push(e),r=e,T+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,u=9999,c=0,f=1,h=2,d=3,p=4,v=5,g=6,m=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(t,e,r){var n=r(6852);n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var n=r(620);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var n=r(5874);t.exports=function(t,e){var r=n(e),i=[];return(i=i.concat(r(t))).concat(r(null))}},3236:function(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*v}},8954:function(t,e,r){"use strict";t.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);var f=new a(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2);for(c=0;c<=i;++c){for(var p=l.slice(),v=0;v<=i;++v)v===c&&(p[v]=-1);var g=p[0];p[0]=p[1],p[1]=g;var m=new a(p,new Array(i+1),!0);h[c]=m,d[c]=m}for(d[i+1]=f,c=0;c<=i;++c){p=h[c].vertices;var y=h[c].adjacent;for(v=0;v<=i;++v){var x=p[v];if(x<0)y[v]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[v]=h[b])}}var _=new u(i,o,d),w=!!e;for(c=i+1;c0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];for(s.lastVisited=r,c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var d=this.orient();if(a[c]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,v=d.indexOf(r);if(!(v<0))for(var g=0;g<=n;++g)if(g!==v){var m=p[g];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var _=m.adjacent,w=d.slice(),M=p.slice(),T=new a(w,M,!0);c.push(T);var A=_.indexOf(e);if(!(A<0))for(_[A]=T,M[v]=m,w[g]=-1,M[g]=e,p[g]=T,T.flip(),b=0;b<=n;++b){var k=w[b];if(!(k<0||k===r)){for(var L=new Array(n-1),S=0,E=0;E<=n;++E){var O=w[E];O<0||E===b||(L[S++]=O)}h.push(new o(L,T,b))}}}}}for(h.sort(s),g=0;g+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},3352:function(t,e,r){"use strict";var n=r(2478);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new m(g(t)):new m(null)};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function h(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,p),i=n.ge(this.rightPoints,t,v);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,p);athis.mid?this.right&&(r=this.right.queryPoint(t,e))?r:f(this.rightPoints,t,e):h(this.leftPoints,e);var r},a.queryInterval=function(t,e,r){var n;return tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=m.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},7762:function(t){"use strict";t.exports=function(t){for(var e=new Array(t),r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},395:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},2652:function(t,e,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),u={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},c=i(),f=i(),h=[0,0,0,0],d=[[0,0,0],[0,0,0],[0,0,0]],p=[0,0,0];function v(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,m){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),m||(m=[0,0,0,1]),!n(c,t))return!1;if(a(f,c),f[3]=0,f[7]=0,f[11]=0,f[15]=1,Math.abs(o(f)<1e-8))return!1;var y,x,b,_,w,M,T,A=c[3],k=c[7],L=c[11],S=c[12],E=c[13],O=c[14],C=c[15];if(0!==A||0!==k||0!==L){if(h[0]=A,h[1]=k,h[2]=L,h[3]=C,!s(f,f))return!1;l(f,f),y=g,b=f,_=(x=h)[0],w=x[1],M=x[2],T=x[3],y[0]=b[0]*_+b[4]*w+b[8]*M+b[12]*T,y[1]=b[1]*_+b[5]*w+b[9]*M+b[13]*T,y[2]=b[2]*_+b[6]*w+b[10]*M+b[14]*T,y[3]=b[3]*_+b[7]*w+b[11]*M+b[15]*T}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=S,e[1]=E,e[2]=O,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(d,c),r[0]=u.length(d[0]),u.normalize(d[0],d[0]),i[0]=u.dot(d[0],d[1]),v(d[1],d[1],d[0],1,-i[0]),r[1]=u.length(d[1]),u.normalize(d[1],d[1]),i[0]/=r[1],i[1]=u.dot(d[0],d[2]),v(d[2],d[2],d[0],1,-i[1]),i[2]=u.dot(d[1],d[2]),v(d[2],d[2],d[1],1,-i[2]),r[2]=u.length(d[2]),u.normalize(d[2],d[2]),i[1]/=r[2],i[2]/=r[2],u.cross(p,d[1],d[2]),u.dot(d[0],p)<0)for(var R=0;R<3;R++)r[R]*=-1,d[R][0]*=-1,d[R][1]*=-1,d[R][2]*=-1;return m[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),m[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),m[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),m[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(m[0]=-m[0]),d[0][2]>d[2][0]&&(m[1]=-m[1]),d[1][0]>d[0][1]&&(m[2]=-m[2]),!0}},4335:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7442:function(t,e,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=f(),u=f(),c=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!d||(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),i(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},7182:function(t,e,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());t.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},4192:function(t,e,r){"use strict";var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),u=r(6582),c=r(7656),f=(r(2504),r(3536)),h=[0,0,0];function d(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new d((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=d.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(u=0;u<16;++u)h[u]=s[l++];var p=this.nextMatrix;for(u=0;u<16;++u)p[u]=s[l++],d=d&&h[u]===p[u];if(c<1e-6||d)for(u=0;u<16;++u)o[u]=h[u];else i(o,h,p,(t-e[r])/c)}var v=this.computedUp;v[0]=o[1],v[1]=o[5],v[2]=o[9],f(v,v);var g=this.computedInverse;a(g,o);var m=this.computedEye,y=g[15];m[0]=g[12]/y,m[1]=g[13]/y,m[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)x[u]=m[u]-o[2+4*u]*b}},p.idle=function(t){if(!(t1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(i=0,o.length);i0;--d)r[f++]=s[d];return r};var n=r(3250)[3]},351:function(t,e,r){"use strict";t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function d(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function v(t){u(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",v),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}g();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",v),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=r(4687)},24:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(t,e){"use strict";function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var o=t.getters||[],s=new Array(a),l=0;l=0?s[l]=!0:s[l]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,s)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var u,c=0|a.shape[0],f=0|a.shape[1],h=a.data,d=0|a.offset,p=0|a.stride[0],v=0|a.stride[1],g=d,m=0|-p,y=0,x=0|-v,b=0,_=-p-v|0,w=0,M=0|p,T=v-p*c|0,A=0,k=0,L=0,S=2*c|0,E=n(S),O=n(S),C=0,R=0,D=-1,P=-1,I=0,z=0|-c,F=0|c,N=0,B=-c-1|0,j=c-1|0,U=0,H=0,V=0;for(A=0;A0){if(k=1,E[C++]=r(h[g],o,s,l),g+=M,c>0)for(A=1,u=h[g],R=E[C]=r(u,o,s,l),I=E[C+D],N=E[C+z],U=E[C+B],R===I&&R===N&&R===U||(y=h[g+m],b=h[g+x],w=h[g+_],t(A,k,u,y,b,w,R,I,N,U,o,s,l),H=O[C]=L++),C+=1,g+=M,A=2;A0)for(A=1,u=h[g],R=E[C]=r(u,o,s,l),I=E[C+D],N=E[C+z],U=E[C+B],R===I&&R===N&&R===U||(y=h[g+m],b=h[g+x],w=h[g+_],t(A,k,u,y,b,w,R,I,N,U,o,s,l),H=O[C]=L++,U!==N&&e(O[C+z],H,b,w,N,U,o,s,l)),C+=1,g+=M,A=2;A0){if(A=1,E[C++]=r(h[g],o,s,l),g+=M,f>0)for(k=1,u=h[g],R=E[C]=r(u,o,s,l),N=E[C+z],I=E[C+D],U=E[C+B],R===N&&R===I&&R===U||(y=h[g+m],b=h[g+x],w=h[g+_],t(A,k,u,y,b,w,R,N,I,U,o,s,l),H=O[C]=L++),C+=1,g+=M,k=2;k0)for(k=1,u=h[g],R=E[C]=r(u,o,s,l),N=E[C+z],I=E[C+D],U=E[C+B],R===N&&R===I&&R===U||(y=h[g+m],b=h[g+x],w=h[g+_],t(A,k,u,y,b,w,R,N,I,U,o,s,l),H=O[C]=L++,U!==N&&e(O[C+z],H,w,y,U,N,o,s,l)),C+=1,g+=M,k=2;k2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}t.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(a=c[e])return a;for(var r=t.length,n=[f,h],i=1;i<=r;++i)n.push(d(i));var a=p.apply(void 0,n);return c[e]=a,a}(r)(t,e)}},4317:function(t){"use strict";function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|t[1];b>0;){b<64?(u=b,b=0):(u=64,b-=64),n=m+x*f+b*h,o=y+x*p+b*v;var _=0,w=0,M=0,T=d,A=f-c*d,k=h-l*f,L=g,S=p-c*g,E=v-l*p;for(M=0;M0;){v<64?(l=v,v=0):(l=64,v-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=d+v*c+g*u,o=p+v*h+g*f;var m=0,y=0,x=c,b=u-l*c,_=h,w=f-l*h;for(y=0;y0;){y<64?(u=y,y=0):(u=64,y-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|t[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=g+y*h+x*c+b*f,o=m+y*v+x*d+b*p;var _=0,w=0,M=0,T=h,A=c-u*h,k=f-s*c,L=v,S=d-u*v,E=p-s*d;for(M=0;Mr;){m=0,y=v-o;e:for(g=0;gb)break e;y+=f,m+=h}for(m=v,y=v-o,g=0;g>1,Y=V-j,G=V+j,W=U,q=Y,X=V,Z=G,J=H,K=i+1,Q=a-1,$=!0,tt=0,et=0,rt=0,nt=f,it=e(nt),at=e(nt);A=l*W,k=l*q,B=s;t:for(T=0;T0){g=W,W=q,q=g;break t}if(rt<0)break t;B+=d}A=l*Z,k=l*J,B=s;t:for(T=0;T0){g=Z,Z=J,J=g;break t}if(rt<0)break t;B+=d}A=l*W,k=l*X,B=s;t:for(T=0;T0){g=W,W=X,X=g;break t}if(rt<0)break t;B+=d}A=l*q,k=l*X,B=s;t:for(T=0;T0){g=q,q=X,X=g;break t}if(rt<0)break t;B+=d}A=l*W,k=l*Z,B=s;t:for(T=0;T0){g=W,W=Z,Z=g;break t}if(rt<0)break t;B+=d}A=l*X,k=l*Z,B=s;t:for(T=0;T0){g=X,X=Z,Z=g;break t}if(rt<0)break t;B+=d}A=l*q,k=l*J,B=s;t:for(T=0;T0){g=q,q=J,J=g;break t}if(rt<0)break t;B+=d}A=l*q,k=l*X,B=s;t:for(T=0;T0){g=q,q=X,X=g;break t}if(rt<0)break t;B+=d}A=l*Z,k=l*J,B=s;t:for(T=0;T0){g=Z,Z=J,J=g;break t}if(rt<0)break t;B+=d}for(A=l*W,k=l*q,L=l*X,S=l*Z,E=l*J,O=l*U,C=l*V,R=l*H,N=0,B=s,T=0;T0)){if(rt<0){for(A=l*b,k=l*K,L=l*Q,B=s,T=0;T0)for(;;){for(_=s+Q*l,N=0,T=0;T0)){for(_=s+Q*l,N=0,T=0;TH){t:for(;;){for(_=s+K*l,N=0,B=s,T=0;T1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,u)}},446:function(t,e,r){"use strict";var n=r(7640),i={};t.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},9618:function(t,e,r){var n=r(7163),i="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=u(-r/l)):r=u(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=u(-i/l)):i=u(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],f=this.stride[2];return"number"==typeof t&&t>=0&&(i+=u*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=c*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=f*(a=0|r),l-=a),new n(this.data,o,s,l,u,c,f,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,f=0,h=Math.ceil;return"number"==typeof t&&((f=0|t)<0?(c+=s*(i-1),i=h(-i/f)):i=h(i/f),s*=f),"number"==typeof e&&((f=0|e)<0?(c+=l*(a-1),a=h(-a/f)):a=h(a/f),l*=f),"number"==typeof r&&((f=0|r)<0?(c+=u*(o-1),o=h(-o/f)):o=h(o/f),u*=f),new n(this.data,i,a,o,s,l,u,c)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,u){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|u}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3];return"number"==typeof t&&t>=0&&(a+=f*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=h*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=d*(o=0|r),u-=o),"number"==typeof i&&i>=0&&(a+=p*(o=0|i),c-=o),new n(this.data,s,l,u,c,f,h,d,p,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],f=this.stride[2],h=this.stride[3],d=this.offset,p=0,v=Math.ceil;return"number"==typeof t&&((p=0|t)<0?(d+=u*(a-1),a=v(-a/p)):a=v(a/p),u*=p),"number"==typeof e&&((p=0|e)<0?(d+=c*(o-1),o=v(-o/p)):o=v(o/p),c*=p),"number"==typeof r&&((p=0|r)<0?(d+=f*(s-1),s=v(-s/p)):s=v(s/p),f*=p),"number"==typeof i&&((p=0|i)<0?(d+=h*(l-1),l=v(-l/p)):l=v(l/p),h*=p),new n(this.data,a,o,s,l,u,c,f,h,d)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,u,c,f){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,u,c],this.offset=0|f}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],f=this.shape[3],h=this.shape[4],d=this.stride[0],p=this.stride[1],v=this.stride[2],g=this.stride[3],m=this.stride[4];return"number"==typeof t&&t>=0&&(o+=d*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=p*(s=0|e),u-=s),"number"==typeof r&&r>=0&&(o+=v*(s=0|r),c-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),f-=s),"number"==typeof a&&a>=0&&(o+=m*(s=0|a),h-=s),new n(this.data,l,u,c,f,h,d,p,v,g,m,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],f=this.stride[0],h=this.stride[1],d=this.stride[2],p=this.stride[3],v=this.stride[4],g=this.offset,m=0,y=Math.ceil;return"number"==typeof t&&((m=0|t)<0?(g+=f*(o-1),o=y(-o/m)):o=y(o/m),f*=m),"number"==typeof e&&((m=0|e)<0?(g+=h*(s-1),s=y(-s/m)):s=y(s/m),h*=m),"number"==typeof r&&((m=0|r)<0?(g+=d*(l-1),l=y(-l/m)):l=y(l/m),d*=m),"number"==typeof i&&((m=0|i)<0?(g+=p*(u-1),u=y(-u/m)):u=y(u/m),p*=m),"number"==typeof a&&((m=0|a)<0?(g+=v*(c-1),c=y(-c/m)):c=y(c/m),v*=m),new n(this.data,o,s,l,u,c,f,h,d,p,v,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,u[t][0]):n(t,u[t],o)}var u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===a)for(a=0,s=0;s>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[u],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,M=(x+2)%3;b[x]+=_*(m[w]*v[M]-m[M]*v[w])}}}for(o=0;oa)for(_=1/Math.sqrt(T),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0,u=0;u<3;++u)h[u]*=d;i[o]=h}return i}},4081:function(t){"use strict";t.exports=function(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(f>0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,u);f=Math.sqrt(2*h-c+1),e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},9977:function(t,e,r){"use strict";t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=u(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=l(c-=a*d,f-=o*d,h-=s*d);c/=p,f/=p,h/=p;var v=i[2],g=i[6],m=i[10],y=v*a+g*o+m*s,x=v*c+g*f+m*h,b=l(v-=y*a+x*c,g-=y*o+x*f,m-=y*s+x*h);v/=b,g/=b,m/=b;var _=c*e+a*r,w=f*e+o*r,M=h*e+s*r;this.center.move(t,_,w,M);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(t,Math.log(T))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],f=i[5],h=i[9],d=i[2],p=i[6],v=i[10],g=e*a+r*c,m=e*o+r*f,y=e*s+r*h,x=-(p*y-v*m),b=-(v*g-d*y),_=-(d*m-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=u(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var T=this.computedRotation,A=T[0],k=T[1],L=T[2],S=T[3],E=A*w+S*x+k*_-L*b,O=k*w+S*b+L*x-A*_,C=L*w+S*_+A*b-k*x,R=S*w-A*x-k*b-L*_;if(n){x=d,b=p,_=v;var D=Math.sin(n)/l(x,b,_);x*=D,b*=D,_*=D,R=R*(w=Math.cos(e))-(E=E*w+R*x+O*_-C*b)*x-(O=O*w+R*b+C*x-E*_)*b-(C=C*w+R*_+E*b-O*x)*_}var P=u(E,O,C,R);P>1e-6?(E/=P,O/=P,C/=P,R/=P):(E=O=C=0,R=1),this.rotation.set(t,E,O,C,R)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371:function(t,e,r){"use strict";var n=r(3233);t.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},3202:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},3088:function(t,e,r){"use strict";t.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],d=0;d0&&(o=p,s=v,l=f)}return i||o&&u(o,l),s}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=c(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){a[0][o].length;var v=f(o,d);h(0,v)?p.push.apply(p,v):(p.length>0&&l.push(p),p=v)}p.length>0&&l.push(p)}return l};var n=r(3140)},5609:function(t,e,r){"use strict";t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){i[d=o.pop()]=!1;var u=r[d];for(s=0;s0}))).length,g=new Array(v),m=new Array(v);for(d=0;d0;){var N=z.pop(),B=S[N];l(B,(function(t,e){return t-e}));var j,U=B.length,H=F[N];for(0===H&&(j=[V=p[N]]),d=0;d=0||(F[Y]=1^H,z.push(Y),0===H&&(I(V=p[Y])||(V.reverse(),j.push(V))))}0===H&&r.push(j)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),u=r(5609);function c(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(m.slabs,m.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(t){for(var e={},r=0;r=u?(T=1,y=u+2*h+p):y=h*(T=-h/u)+p):(T=0,d>=0?(A=0,y=p):-d>=f?(A=1,y=f+2*d+p):y=d*(A=-d/f)+p);else if(A<0)A=0,h>=0?(T=0,y=p):-h>=u?(T=1,y=u+2*h+p):y=h*(T=-h/u)+p;else{var k=1/M;y=(T*=k)*(u*T+c*(A*=k)+2*h)+A*(c*T+f*A+2*d)+p}else T<0?(b=f+d)>(x=c+h)?(_=b-x)>=(w=u-2*c+f)?(T=1,A=0,y=u+2*h+p):y=(T=_/w)*(u*T+c*(A=1-T)+2*h)+A*(c*T+f*A+2*d)+p:(T=0,b<=0?(A=1,y=f+2*d+p):d>=0?(A=0,y=p):y=d*(A=-d/f)+p):A<0?(b=u+h)>(x=c+d)?(_=b-x)>=(w=u-2*c+f)?(A=1,T=0,y=f+2*d+p):y=(T=1-(A=_/w))*(u*T+c*A+2*h)+A*(c*T+f*A+2*d)+p:(A=0,b<=0?(T=1,y=u+2*h+p):h>=0?(T=0,y=p):y=h*(T=-h/u)+p):(_=f+d-c-h)<=0?(T=0,A=1,y=f+2*d+p):_>=(w=u-2*c+f)?(T=1,A=0,y=u+2*h+p):y=(T=_/w)*(u*T+c*(A=1-T)+2*h)+A*(c*T+f*A+2*d)+p;var L=1-T-A;for(l=0;l0){var u=t[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},3233:function(t){"use strict";var e,r="";t.exports=function(t,n){if("string"!=typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||void 0===e)e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){"use strict";t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],d=r[2]-n[2],p=a*u,v=o*l,g=o*s,m=i*u,y=i*l,x=a*s,b=c*(p-v)+f*(g-m)+d*(y-x),_=7771561172376103e-31*((Math.abs(p)+Math.abs(v))*Math.abs(c)+(Math.abs(g)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(d));return b>_||-b>_?b:h(t,e,r,n)}];function p(t){var e=d[t.length];return e||(e=d[t.length]=c(t.length)),e.apply(void 0,t)}function v(t,e,r,n,i,a,o){return function(e,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,u)}for(var c=new Array(arguments.length),f=0;f0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c);if(Math.max(u,c)=n?(i=f,(l+=1)=n?(i=f,(l+=1)>1,u=e[2*l+1];if(u===a)return l;a>1,u=e[2*l+1];if(u===a)return l;a>1,u=e[2*l+1];if(u===a)return l;a0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},2014:function(t,e,r){"use strict";var n=r(3105),i=r(4623);function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),u=i(e[0],e[1]);return(s=i(l,t[2])-i(u,e[2]))||i(l+t[2],a)-i(u+e[2],o);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var h=0;h>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);e.push(u)}return s(e)},e.skeleton=f,e.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=m(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(!(r>=0&&e0){var t=T[0];return g(0,k-1),k-=1,x(0),t}return-1}function w(t,e){var r=T[t];return u[r]===e?t:(u[r]=-1/0,b(t),_(),u[r]=e,b((k+=1)-1))}function M(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],v(e)),A[r]>=0&&w(A[r],v(r))}}var T=[],A=new Array(a);for(f=0;f>1;f>=0;--f)x(f);for(;;){var L=_();if(L<0||u[L]>r)break;M(L)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&O.push([n,i])}})),i.unique(i.normalize(O)),{positions:S,edges:O}};var n=r(3250),i=r(2014)},1303:function(t,e,r){"use strict";t.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=r(3250);function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;d=f[h]}}if(d.start)if(s){var p=a(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(i=d.index)}else i=d.index;else d.y!==t[1]&&(i=d.index)}}}return i}},5202:function(t,e,r){"use strict";var n=r(1944),i=r(8210);function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},t.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},3387:function(t,e,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,u,c,f,h,d=1,p=t.length,v="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?v+=r:(!i.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+r).length,l=s.width&&c>0?u.repeat(c):"",v+=s.align?h+r+l:"0"===u?h+l+r:l+h+r)}return v}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()},3711:function(t,e,r){"use strict";t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,i,a,o,s,l,u,c,f,h){var d=(o<<0)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==d&&15!==d)switch(d){case 0:case 15:c.push([t-.5,e-.5]);break;case 1:c.push([t-.25-.25*(n+r-2*h)/(r-n),e-.25-.25*(i+r-2*h)/(r-i)]);break;case 2:c.push([t-.75-.25*(-n-r+2*h)/(n-r),e-.25-.25*(a+n-2*h)/(n-a)]);break;case 3:c.push([t-.5,e-.5-.5*(i+r+a+n-4*h)/(r-i+n-a)]);break;case 4:c.push([t-.25-.25*(a+i-2*h)/(i-a),e-.75-.25*(-i-r+2*h)/(i-r)]);break;case 5:c.push([t-.5-.5*(n+r+a+i-4*h)/(r-n+i-a),e-.5]);break;case 6:c.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:c.push([t-.75-.25*(a+i-2*h)/(i-a),e-.75-.25*(a+n-2*h)/(n-a)]);break;case 8:c.push([t-.75-.25*(-a-i+2*h)/(a-i),e-.75-.25*(-a-n+2*h)/(a-n)]);break;case 9:c.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:c.push([t-.5-.5*(-n-r-a-i+4*h)/(n-r+a-i),e-.5]);break;case 11:c.push([t-.25-.25*(-a-i+2*h)/(a-i),e-.75-.25*(i+r-2*h)/(r-i)]);break;case 12:c.push([t-.5,e-.5-.5*(-i-r-a-n+4*h)/(i-r+a-n)]);break;case 13:c.push([t-.75-.25*(n+r-2*h)/(r-n),e-.25-.25*(-a-n+2*h)/(a-n)]);break;case 14:c.push([t-.25-.25*(-n-r+2*h)/(n-r),e-.25-.25*(-i-r+2*h)/(i-r)])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},o={}},529:function(t,e,r){"use strict";t.exports=function t(e,r,n){var a=(n=n||{}).fontStyle||"normal",s=n.fontWeight||"normal",l=n.fontVariant||"normal",u=[a,s,l,e].join("_"),c=o[u];c||(c=o[u]={" ":{data:new Float32Array(0),shape:.2}});var f=c[r];if(!f)if(r.length<=1||!/\d/.test(r))f=c[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(v+=.02);var m=new Float32Array(p),y=0,x=-.5*v;for(g=0;gMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var d=h.prototype;d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],v=this.computedAngle[1],g=Math.cos(p),m=Math.sin(p),y=Math.cos(v),x=Math.sin(v),b=this.computedCenter,_=g*y,w=m*y,M=x,T=-g*x,A=-m*x,k=y,L=this.computedEye,S=this.computedMatrix;for(a=0;a<3;++a){var E=_*r[a]+w*h[a]+M*e[a];S[4*a+1]=T*r[a]+A*h[a]+k*e[a],S[4*a+2]=E,S[4*a+3]=0}var O=S[1],C=S[5],R=S[9],D=S[2],P=S[6],I=S[10],z=C*I-R*P,F=R*D-O*I,N=O*P-C*D,B=u(z,F,N);for(z/=B,F/=B,N/=B,S[0]=z,S[4]=F,S[8]=N,a=0;a<3;++a)L[a]=b[a]+S[2+4*a]*d;for(a=0;a<3;++a){c=0;for(var j=0;j<3;++j)c+=S[a+4*j]*L[j];S[12+a]=-c}S[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];for(a(i,i,n,p),u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=u(c-=a*d,f-=o*d,h-=s*d),v=(c/=p)*e+a*r,g=(f/=p)*e+o*r,m=(h/=p)*e+s*r;this.center.move(t,v,g,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),v=Math.max(h,d,p);h===v?(s=s<0?-1:1,l=f=0):p===v?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var g=u(s,l,f);s/=g,l/=g,f/=g}var m,y,x=e[o],b=e[o+4],_=e[o+8],w=x*s+b*l+_*f,M=u(x-=s*w,b-=l*w,_-=f*w),T=l*(_/=M)-f*(b/=M),A=f*(x/=M)-s*_,k=s*b-l*x,L=u(T,A,k);if(T/=L,A/=L,k/=L,this.center.jump(t,Y,G,W),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,x,b,_),2===a){var S=e[1],E=e[5],O=e[9],C=S*x+E*b+O*_,R=S*T+E*A+O*k;m=z<0?-Math.PI/2:Math.PI/2,y=Math.atan2(R,C)}else{var D=e[2],P=e[6],I=e[10],z=D*s+P*l+I*f,F=D*x+P*b+I*_,N=D*T+P*A+I*k;m=Math.asin(c(z)),y=Math.atan2(N,F)}this.angle.jump(t,y,m),this.recalcMatrix(t);var B=e[2],j=e[6],U=e[10],H=this.computedMatrix;i(H,e);var V=H[15],Y=H[12]/V,G=H[13]/V,W=H[14]/V,q=Math.exp(this.computedRadius[0]);this.center.jump(t,Y-B*q,G-j*q,W-U*q)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=u(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,v=p[0],g=p[1],m=p[2],y=i*v+a*g+o*m,x=u(v-=y*i,g-=y*a,m-=y*o);if(!(x<.01&&(x=u(v=a*h-o*f,g=o*l-i*h,m=i*f-a*l))<1e-6)){v/=x,g/=x,m/=x,this.up.set(t,i,a,o),this.right.set(t,v,g,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var b=a*m-o*g,_=o*v-i*m,w=i*g-a*v,M=u(b,_,w),T=i*l+a*f+o*h,A=v*l+g*f+m*h,k=(b/=M)*l+(_/=M)*f+(w/=M)*h,L=Math.asin(c(T)),S=Math.atan2(k,A),E=this.angle._state,O=E[E.length-1],C=E[E.length-2];O%=2*Math.PI;var R=Math.abs(O+2*Math.PI-S),D=Math.abs(O-S),P=Math.abs(O-2*Math.PI-S);R0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function v(t){return new Uint16Array(d(2*t),0,t)}function g(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function x(t){return new Int32Array(d(4*t),0,t)}function b(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function M(t){return s?new BigUint64Array(d(8*t),0,t):null}function T(t){return l?new BigInt64Array(d(8*t),0,t):null}function A(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);c[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){h(t.buffer)},e.freeArrayBuffer=h,e.freeBuffer=function(t){f[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return v(t);case"uint32":return g(t);case"int8":return m(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return T(t);case"biguint64":return M(t);case"buffer":return k(t);case"data":case"dataview":return A(t);default:return null}return null},e.mallocArrayBuffer=d,e.mallocUint8=p,e.mallocUint16=v,e.mallocUint32=g,e.mallocInt8=m,e.mallocInt16=y,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=b,e.mallocFloat64=e.mallocDouble=_,e.mallocUint8Clamped=w,e.mallocBigUint64=M,e.mallocBigInt64=T,e.mallocDataView=A,e.mallocBuffer=k,e.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}},1755:function(t){"use strict";function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(M=0;M-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),k*=Math.pow(.75,l-s),n=n.replace("?px ",F())),A+=.25*E*(l-s)}if(!0===o.superscripts){var u=t.indexOf(p),f=r.indexOf(p),d=u>-1?parseInt(t[1+u]):0,v=f>-1?parseInt(r[1+f]):0;d!==v&&(n=n.replace(F(),"?px "),k*=Math.pow(.75,v-d),n=n.replace("?px ",F())),A-=.25*E*(v-d)}if(!0===o.bolds){var g=t.indexOf(c)>-1,y=r.indexOf(c)>-1;!g&&y&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!y&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(h)>-1,b=r.indexOf(h)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=e[0]===p||e[0]===m,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,v=r.substr(d,c-d).indexOf(i);u=-1!==v?v:c+s}return n}function b(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(t,e,r,n){var i=b(t,n),a=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i}))},has___:{value:x((function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:x((function(n,i){var a,o=y(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=y(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))}))}})};v.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof v||b();var t,n=new r,i=void 0,a=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new v),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new v),i.set___(t,e)}else n.set(t,e);return this},Object.create(v.prototype,{get___:{value:x((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:x((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:x(t)},delete___:{value:x((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:x((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}e&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=v.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),t.exports=v)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function m(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function b(){d||"undefined"==typeof console||(d=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(t,e,r){var n=r(8284);t.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},8284:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},606:function(t,e,r){var n=r(236);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},3349:function(t){"use strict";t.exports=function(t){var e={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=e[s];return l||(e[s]=l=t([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],u=s;n|=0;var c=0,f=s;for(c=0;c=0!=d>=0&&i.push(l[0]+.5+.5*(h+d)/(h-d)),n+=f,++l[0]}}}.bind(void 0,{funcName:"zeroCrossings"}))},781:function(t,e,r){"use strict";t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(3349)},7790:function(){}},r={};function i(t){var n=r[t];if(void 0!==n)return n.exports;var a=r[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var a=i(1964);t.exports=a}()},5928:function(t){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},3428:function(t,e,r){var n,i;(function(){var a={version:"3.8.2"},o=[].slice,s=function(t){return o.call(t)},l=self.document;function u(t){return t&&(t.ownerDocument||t.document||t).documentElement}function c(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(t){s=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var f=this.Element.prototype,h=f.setAttribute,d=f.setAttributeNS,p=this.CSSStyleDeclaration.prototype,v=p.setProperty;f.setAttribute=function(t,e){h.call(this,t,e+"")},f.setAttributeNS=function(t,e,r){d.call(this,t,e,r+"")},p.setProperty=function(t,e,r){v.call(this,t,e+"",r)}}function g(t,e){return te?1:t>=e?0:NaN}function m(t){return null===t?NaN:+t}function y(t){return!isNaN(t)}function x(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}a.ascending=g,a.descending=function(t,e){return et?1:e>=t?0:NaN},a.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},a.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},a.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},a.deviation=function(){var t=a.variance.apply(this,arguments);return t?Math.sqrt(t):t};var b=x(g);function _(t){return t.length}a.bisectLeft=b.left,a.bisect=a.bisectRight=b.right,a.bisector=function(t){return x(1===t.length?function(e,r){return g(t(e),r)}:t)},a.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},a.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},a.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var w=Math.abs;function M(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function T(){this._=Object.create(null)}a.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){for(var e=1;t*e%1;)e*=10;return e}(w(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=n.length)return e?e.call(r,a):t?a.sort(t):a;for(var l,u,c,f,h=-1,d=a.length,p=n[s++],v=new T;++h=n.length)return t;var r=[],a=i[e++];return t.forEach((function(t,n){r.push({key:t,values:s(n,e)})})),a?r.sort((function(t,e){return a(t.key,e.key)})):r}return r.map=function(t,e){return o(e,t,0)},r.entries=function(t){return s(o(a.map,t,0),0)},r.key=function(t){return n.push(t),r},r.sortKeys=function(t){return i[n.length-1]=t,r},r.sortValues=function(e){return t=e,r},r.rollup=function(t){return e=t,r},r},a.set=function(t){var e=new P;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},a.event=null,a.requote=function(t){return t.replace(G,"\\$&")};var G=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,W={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function q(t){return W(t,K),t}var X=function(t,e){return e.querySelector(t)},Z=function(t,e){return e.querySelectorAll(t)},J=function(t,e){var r=t.matches||t[F(t,"matchesSelector")];return J=function(t,e){return r.call(t,e)},J(t,e)};"function"==typeof Sizzle&&(X=function(t,e){return Sizzle(t,e)[0]||null},Z=Sizzle,J=Sizzle.matchesSelector),a.selection=function(){return a.select(l.documentElement)};var K=a.selection.prototype=[];function Q(t){return"function"==typeof t?t:function(){return X(t,this)}}function $(t){return"function"==typeof t?t:function(){return Z(t,this)}}K.select=function(t){var e,r,n,i,a=[];t=Q(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),et.hasOwnProperty(r)?{space:et[r],local:t}:t}},K.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=a.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},K.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=at(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},K.sort=function(t){t=pt.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(t=t.slice(0,i));var l=xt.get(t);function u(){var e=this[n];e&&(this.removeEventListener(t,e,e.$),delete this[n])}return l&&(t=l,o=_t),i?e?function(){var i=o(e,s(arguments));u.call(this),this.addEventListener(t,this[n]=i,i.$=r),i._=e}:u:e?B:function(){var e,r=new RegExp("^__on([^.]+)"+a.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}}a.selection.enter=gt,a.selection.enter.prototype=mt,mt.append=K.append,mt.empty=K.empty,mt.node=K.node,mt.call=K.call,mt.size=K.size,mt.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n1?Dt:t<-1?-Dt:Math.asin(t)}function Ft(t){return((t=Math.exp(t))+1/t)/2}var Nt=Math.SQRT2;a.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,f=l-a,h=c*c+f*f;if(h0&&(t=t.transition().duration(v)),t.call(w.event)}function L(){s&&s.domain(o.range().map((function(t){return(t-h.x)/h.k})).map(o.invert)),f&&f.domain(u.range().map((function(t){return(t-h.y)/h.k})).map(u.invert))}function S(t){g++||t({type:"zoomstart"})}function E(t){L(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function O(t){--g||(t({type:"zoomend"}),e=null)}function C(){var t=this,e=_.of(t,arguments),r=0,n=a.select(c(t)).on(y,(function(){r=1,A(a.mouse(t),i),E(e)})).on(x,(function(){n.on(y,null).on(x,null),o(r),O(e)})),i=M(a.mouse(t)),o=Tt(t);Ji.call(t),S(e)}function R(){var t,e=this,r=_.of(e,arguments),n={},o=0,s=".zoom-"+a.event.changedTouches[0].identifier,l="touchmove"+s,u="touchend"+s,c=[],f=a.select(e),d=Tt(e);function p(){var r=a.touches(e);return t=h.k,r.forEach((function(t){t.identifier in n&&(n[t.identifier]=M(t))})),r}function v(){var t=a.event.target;a.select(t).on(l,g).on(u,y),c.push(t);for(var r=a.event.changedTouches,s=0,f=r.length;s1){m=d[0];var x=d[1],b=m[0]-x[0],_=m[1]-x[1];o=b*b+_*_}}function g(){var s,l,u,c,f=a.touches(e);Ji.call(e);for(var h=0,d=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Wt(t,e,r){return this instanceof Wt?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Wt?new Wt(t.h,t.c,t.l):function(t,e,r){return t>0?new Wt(Math.atan2(r,e)*It,Math.sqrt(e*e+r*r),t):new Wt(NaN,NaN,t)}(t instanceof Zt?t.l:(t=he((t=a.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Wt(t,e,r)}Yt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},Yt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},Yt.rgb=function(){return Gt(this.h,this.s,this.l)},a.hcl=Wt;var qt=Wt.prototype=new Ht;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Zt(r,Math.cos(t*=Pt)*e,Math.sin(t)*e)}function Zt(t,e,r){return this instanceof Zt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Zt?new Zt(t.l,t.a,t.b):t instanceof Wt?Xt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Zt(t,e,r)}qt.brighter=function(t){return new Wt(this.h,this.c,Math.min(100,this.l+Jt*(arguments.length?t:1)))},qt.darker=function(t){return new Wt(this.h,this.c,Math.max(0,this.l-Jt*(arguments.length?t:1)))},qt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},a.lab=Zt;var Jt=18,Kt=.95047,Qt=1,$t=1.08883,te=Zt.prototype=new Ht;function ee(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Kt)-1.5371385*(n=re(n)*Qt)-.4985314*(a=re(a)*$t)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ce(""+t,ae,Gt):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}te.brighter=function(t){return new Zt(Math.min(100,this.l+Jt*(arguments.length?t:1)),this.a,this.b)},te.darker=function(t){return new Zt(Math.max(0,this.l-Jt*(arguments.length?t:1)),this.a,this.b)},te.rgb=function(){return ee(this.l,this.a,this.b)},a.rgb=ae;var le=ae.prototype=new Ht;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ce(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(pe(i[0]),pe(i[1]),pe(i[2]))}return(a=ve.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function fe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Vt(n,i,l)}function he(t,e,r){var n=ne((.4124564*(t=de(t))+.3575761*(e=de(e))+.1804375*(r=de(r)))/Kt),i=ne((.2126729*t+.7151522*e+.072175*r)/Qt);return Zt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/$t)))}function de(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=r.call(i,u)}catch(t){return void o.error.call(i,t)}o.load.call(i,t)}else o.error.call(i,u)}return self.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(t)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(t){var e=a.event;a.event=t;try{o.progress.call(i,u)}finally{a.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.responseType=function(t){return arguments.length?(c=t,i):c},i.response=function(t){return r=t,i},["get","post"].forEach((function(t){i[t]=function(){return i.send.apply(i,[t].concat(s(arguments)))}})),i.send=function(r,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),u.setRequestHeader)for(var s in l)u.setRequestHeader(s,l[s]);return null!=e&&u.overrideMimeType&&u.overrideMimeType(e),null!=c&&(u.responseType=c),null!=a&&i.on("error",a).on("load",(function(t){a(null,t)})),o.beforesend.call(i,u),u.send(null==n?null:n),i},i.abort=function(){return u.abort(),i},a.rebind(i,o,"on"),null==n?i:i.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}ve.forEach((function(t,e){ve.set(t,oe(e))})),a.functor=ge,a.xhr=me(I),a.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Ae,e)),_e=0):(_e=1,Me(Ae))}function ke(){for(var t=Date.now(),e=xe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Le(){for(var t,e=xe,r=1/0;e;)e.c?(e.t1&&(e=t[a[o-2]],r=t[a[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function Ce(t,e){return t[0]-e[0]||t[1]-e[1]}a.timer=function(){Te.apply(this,arguments)},a.timer.flush=function(){ke(),Le()},a.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},a.geom={},a.geom.hull=function(t){var e=Se,r=Ee;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ge(e),a=ge(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)d.push(t[s[u[n]][2]]);for(n=+f;nSt)s=s.L;else{if(!((i=a-Ze(s,o))>St)){n>-St?(e=s.P,r=s):i>-St?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ye(t);if(Ne.insert(e,l),e||r){if(e===r)return tr(e),r=Ye(e.site),Ne.insert(l,r),l.edge=r.edge=nr(e.site,l.site),$e(e),void $e(r);if(r){tr(e),tr(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,v=p.x-c,g=p.y-f,m=2*(h*g-d*v),y=h*h+d*d,x=v*v+g*g,b={x:(g*y-d*x)/m+c,y:(h*x-v*y)/m+f};ir(r.edge,u,p,b),l.edge=nr(u,t,null,b),r.edge=nr(t,p,null,b),$e(e),$e(r)}else l.edge=nr(e.site,l.site)}}function Xe(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function Ze(t,e){var r=t.N;if(r)return Xe(r,e);var n=t.site;return n.y===e?n.x:1/0}function Je(t){this.site=t,this.edges=[]}function Ke(t,e){return e.angle-t.angle}function Qe(){sr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=2*(l*(g=a.y-s)-u*c);if(!(f>=-Et)){var h=l*l+u*u,d=c*c+g*g,p=(g*h-u*d)/f,v=(l*d-c*h)/f,g=v+s,m=He.pop()||new Qe;m.arc=t,m.site=i,m.x=p+o,m.y=g+Math.sqrt(p*p+v*v),m.cy=g,t.circle=m;for(var y=null,x=je._;x;)if(m.y=s)return;if(h>p){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(e/=h,h<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=i-l,h||!(e<0)){if(e/=h,h<0){if(e>f)return;e>c&&(c=e)}else if(h>0){if(e0)){if(e/=d,d<0){if(e0){if(e>f)return;e>c&&(c=e)}if(e=a-u,d||!(e<0)){if(e/=d,d<0){if(e>f)return;e>c&&(c=e)}else if(d>0){if(e0&&(t.a={x:l+c*h,y:u+c*d}),f<1&&(t.b={x:l+f*h,y:u+f*d}),t}}}}}),l=o.length;l--;)(!er(e=o[l],t)||!s(e)||w(e.a.x-e.b.x)St||w(i-r)>St)&&(s.splice(o,0,new ar((m=a.site,y=c,x=w(n-f)St?{x:f,y:w(e-f)St?{x:w(r-p)St?{x:h,y:w(e-h)St?{x:w(r-d)=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/St)*St,y:Math.round(i(t,e)/St)*St,i:e}}))}return o.links=function(t){return fr(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return fr(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Ke),c=-1,f=u.length,h=u[f-1].edge,d=h.l===l?h.r:h.l;++ca&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:xr(r,n)})),a=wr.lastIndex;return av&&(v=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(f=0;fv&&(v=x),b>g&&(g=b),u.push(x),c.push(b)}var _=v-d,M=g-p;function T(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(w(l-r)+w(u-n)<.01)A(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,A(t,c,l,u,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?i=l:o=l,f?a=u:s=u,T(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}_>M?g=p+_:v=d+M;var k={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(k,t,+m(t,++f),+y(t,f),d,p,v,g)}};if(k.visit=function(t){gr(t,k,d,p,v,g)},k.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,f,h,d){if(!(c>a||f>o||h=_)<<1|e>=b,M=w+4;w=0&&!(r=a.interpolators[n](t,e)););return r}function Tr(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Dr(t){return 1-Math.cos(t*Dt)}function Pr(t){return Math.pow(2,10*(t-1))}function Ir(t){return 1-Math.sqrt(1-t*t)}function zr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Fr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Nr(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=jr(i),s=Br(i,a),l=jr(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,r):t,i=r>=0?t.slice(r+1):"in";return n=kr.get(n)||Ar,i=Lr.get(i)||I,e=i(n.apply(null,o.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},a.interpolateHcl=function(t,e){t=a.hcl(t),e=a.hcl(e);var r=t.h,n=t.c,i=t.l,o=e.h-r,s=e.c-n,l=e.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return Xt(r+o*t,n+s*t,i+l*t)+""}},a.interpolateHsl=function(t,e){t=a.hsl(t),e=a.hsl(e);var r=t.h,n=t.s,i=t.l,o=e.h-r,s=e.s-n,l=e.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return Gt(r+o*t,n+s*t,i+l*t)+""}},a.interpolateLab=function(t,e){t=a.lab(t),e=a.lab(e);var r=t.l,n=t.a,i=t.b,o=e.l-r,s=e.a-n,l=e.b-i;return function(t){return ee(r+o*t,n+s*t,i+l*t)+""}},a.interpolateRound=Fr,a.transform=function(t){var e=l.createElementNS(a.ns.prefix.svg,"g");return(a.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Nr(r?r.matrix:Ur)})(t)},Nr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Ur={a:1,b:0,c:0,d:1,e:0,f:0};function Hr(t){return t.length?t.pop()+",":""}function Vr(t,e){var r=[],n=[];return t=a.transform(t),e=a.transform(e),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:xr(t[0],e[0])},{i:i-2,x:xr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(t.translate,e.translate,r,n),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Hr(r)+"rotate(",null,")")-2,x:xr(t,e)})):e&&r.push(Hr(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(Hr(r)+"skewX(",null,")")-2,x:xr(t,e)}):e&&r.push(Hr(r)+"skewX("+e+")")}(t.skew,e.skew,r,n),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Hr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:xr(t[0],e[0])},{i:i-2,x:xr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Hr(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i0?r=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:r=0})):e>0&&(l.start({type:"start",alpha:r=e}),t=Te(s.tick)),s):r},s.start=function(){var t,e,r,a=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(i[n])}function an(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return an(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(nn(t,(function(t){t.children&&(t.value=0)})),an(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},a.layout.partition=function(){var t=a.layout.hierarchy(),e=[1,1];function r(t,e,n,i){var a=t.children;if(t.x=e,t.y=t.depth*i,t.dx=n,t.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=t.value?n/t.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function xn(t){return t.reduce(bn,0)}function bn(t,e){return t+e[1]}function _n(t,e){return wn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Mn(t){return[a.min(t),a.max(t)]}function Tn(t,e){return t.value-e.value}function An(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function kn(t,e){t._pack_next=e,e._pack_prev=t}function Ln(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Sn(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(En),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(Rn(r,n,i=e[2]),x(i),An(r,i),r._pack_prev=i,An(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[a.bisect(h,l,1,p)-1]).y+=v,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(e=t,i):e},i.range=function(t){return arguments.length?(r=ge(t),i):r},i.bins=function(t){return arguments.length?(n="number"==typeof t?function(e){return wn(e,t)}:ge(t),i):n},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},a.layout.pack=function(){var t,e=a.layout.hierarchy().sort(Tn),r=0,n=[1,1];function i(i,a){var o=e.call(this,i,a),s=o[0],l=n[0],u=n[1],c=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,an(s,(function(t){t.r=+c(t.value)})),an(s,Sn),r){var f=r*(t?1:Math.max(2*s.r/l,2*s.r/u))/2;an(s,(function(t){t.r+=f})),an(s,Sn),an(s,(function(t){t.r-=f}))}return Cn(s,l/2,u/2,t?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return i.size=function(t){return arguments.length?(n=t,i):n},i.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,i):t},i.padding=function(t){return arguments.length?(r=+t,i):r},rn(i,e)},a.layout.tree=function(){var t=a.layout.hierarchy().sort(null).value(null),e=Dn,r=[1,1],n=null;function i(i,a){var u=t.call(this,i,a),c=u[0],f=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;od.x&&(d=t),t.depth>p.depth&&(p=t)}));var v=e(h,d)/2-h.x,g=r[0]/(d.x+e(d,h)/2+v),m=r[1]/(p.depth||1);nn(c,(function(t){t.x=(t.x+v)*g,t.y=t.depth*m}))}return u}function o(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,h=l.m;s=In(s),a=Pn(a),s&&a;)l=Pn(l),(o=In(o)).a=t,(i=s.z+f-a.z-u+e(s._,a._))>0&&(zn(Fn(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!In(o)&&(o.t=s,o.m+=f-c),a&&!Pn(l)&&(l.t=a,l.m+=u-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=r[0],t.y=t.depth*r[1]}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(n=null==(r=t)?l:null,i):n?null:r},i.nodeSize=function(t){return arguments.length?(n=null==(r=t)?null:l,i):n?r:null},rn(i,t)},a.layout.cluster=function(){var t=a.layout.hierarchy().sort(null).value(null),e=Dn,r=[1,1],n=!1;function i(i,o){var s,l=t.call(this,i,o),u=l[0],c=0;an(u,(function(t){var r=t.children;r&&r.length?(t.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(r),t.y=function(t){return 1+a.max(t,(function(t){return t.y}))}(r)):(t.x=s?c+=e(t,s):0,t.y=0,s=t)}));var f=Nn(u),h=Bn(u),d=f.x-e(f,h)/2,p=h.x+e(h,f)/2;return an(u,n?function(t){t.x=(t.x-u.x)*r[0],t.y=(u.y-t.y)*r[1]}:function(t){t.x=(t.x-d)/(p-d)*r[0],t.y=(1-(u.y?t.y/u.y:1))*r[1]}),l}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(n=null==(r=t),i):n?null:r},i.nodeSize=function(t){return arguments.length?(n=null!=(r=t),i):n?r:null},rn(i,t)},a.layout.treemap=function(){var t,e=a.layout.hierarchy(),r=Math.round,n=[1,1],i=null,o=jn,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=d(s,v))<=h?(u.pop(),h=n):(s.area-=s.pop().area,p(s,v,a,!1),v=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,v,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(p(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function p(t,e,n,i){var a,o=-1,s=t.length,l=n.x,u=n.y,c=e?r(t.area/e):0;if(e==n.dx){for((i||c>n.dy)&&(c=n.dy);++on.dx)&&(c=n.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=a.random.normal.apply(a,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=a.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?Xn:Yn,l=n?Gr:Yr;return i=o(t,e,l,r),a=o(e,t,l,Mr),s}function s(t){return i(t)}return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},s.range=function(t){return arguments.length?(e=t,o()):e},s.rangeRound=function(t){return s.range(t).interpolate(Fr)},s.clamp=function(t){return arguments.length?(n=t,o()):n},s.interpolate=function(t){return arguments.length?(r=t,o()):r},s.ticks=function(e){return $n(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Kn(t,e),o()},s.copy=function(){return Zn(t,e,r,n)},o()}function Jn(t,e){return a.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Kn(t,e){return Gn(t,Wn(Qn(t,e)[2])),Gn(t,Wn(Qn(t,e)[2])),t}function Qn(t,e){null==e&&(e=10);var r=Hn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function $n(t,e){return a.range.apply(a,Qn(t,e))}function ti(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Gn(n.map(i),r?Math:ei);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Hn(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(r){for(;u0;h--)o.push(a(u)*h);for(u=0;o[u]l;c--);o=o.slice(u,c)}return o},o.copy=function(){return ti(t.copy(),e,r,n)},Jn(o,t)}a.scale.linear=function(){return Zn([0,1],[0,1],Mr,!1)},a.scale.log=function(){return ti(a.scale.linear().domain([0,1]),10,!0,[1,10])};var ei={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function ri(t,e,r){var n=ni(e),i=ni(1/e);function a(e){return t(n(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),a):r},a.ticks=function(t){return $n(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain(Kn(r,t))},a.exponent=function(o){return arguments.length?(n=ni(e=o),i=ni(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return ri(t.copy(),e,r)},Jn(a,t)}function ni(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ii(t,e){var r,n,i;function o(i){return n[((r.get(i)||("range"===e.t?r.set(i,t.push(i)):NaN))-1)%n.length]}function s(e,r){return a.range(t.length).map((function(t){return e+r*t}))}return o.domain=function(n){if(!arguments.length)return t;t=[],r=new T;for(var i,a=-1,s=n.length;++a0?r[n-1]:t[0],nf?0:1;if(u=Rt)return l(u,d)+(s?l(s,1-d):"")+"Z";var p,v,g,m,y,x,b,_,w,M,T,A,k=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(g=n===pi?Math.sqrt(s*s+u*u):+n.apply(this,arguments),d||(L*=-1),u&&(L=zt(g/u*Math.sin(m))),s&&(k=zt(g/s*Math.sin(m)))),u){y=u*Math.cos(c+L),x=u*Math.sin(c+L),b=u*Math.cos(f-L),_=u*Math.sin(f-L);var E=Math.abs(f-c-2*L)<=Ot?0:1;if(L&&bi(y,x,b,_)===d^E){var O=(c+f)/2;y=u*Math.cos(O),x=u*Math.sin(O),b=_=null}}else y=x=0;if(s){w=s*Math.cos(f-k),M=s*Math.sin(f-k),T=s*Math.cos(c+k),A=s*Math.sin(c+k);var C=Math.abs(c-f+2*k)<=Ot?0:1;if(k&&bi(w,M,T,A)===1-d^C){var R=(c+f)/2;w=s*Math.cos(R),M=s*Math.sin(R),T=A=null}}else w=M=0;if(h>St&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){v=s0?0:1}function _i(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,v=(f+d)/2,g=h-c,m=d-f,y=g*g+m*m,x=r-n,b=c*d-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-g*_)/y,M=(-b*g-m*_)/y,T=(b*m+g*_)/y,A=(-b*g+m*_)/y,k=w-p,L=M-v,S=T-p,E=A-v;return k*k+L*L>S*S+E*E&&(w=T,M=A),[[w-l,M-u],[w*r/x,M*r/x]]}function wi(){return!0}function Mi(t){var e=Se,r=Ee,n=wi,i=Ai,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,h=ge(e),d=ge(r);function p(){l.push("M",i(t(u),o))}for(;++c1&&i.push("H",n[0]),i.join("")},"step-before":Li,"step-after":Si,basis:Ci,"basis-open":function(t){if(t.length<4)return Ai(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ri(Ii,a)+","+Ri(Ii,o)),--n;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Ai(t){return t.length>1?t.join("L"):t+"Z"}function ki(t){return t.join("L")+"Z"}function Li(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;uOt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ge(t),a):r},a.source=function(e){return arguments.length?(t=ge(e),a):t},a.target=function(t){return arguments.length?(e=ge(t),a):e},a.startAngle=function(t){return arguments.length?(n=ge(t),a):n},a.endAngle=function(t){return arguments.length?(i=ge(t),a):i},a},a.svg.diagonal=function(){var t=ji,e=Ui,r=Vi;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ge(e),n):t},n.target=function(t){return arguments.length?(e=ge(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},a.svg.diagonal.radial=function(){var t=a.svg.diagonal(),e=Vi,r=t.projection;return t.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Dt;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},a.svg.symbol=function(){var t=Gi,e=Yi;function r(r,n){return(qi.get(t.call(this,r,n))||Wi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ge(e),r):t},r.size=function(t){return arguments.length?(e=ge(t),r):e},r};var qi=a.map({circle:Wi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Zi)),r=e*Zi;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Xi),r=e*Xi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Xi),r=e*Xi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});a.svg.symbolTypes=qi.keys();var Xi=Math.sqrt(3),Zi=Math.tan(30*Pt);K.transition=function(t){for(var e,r,n=$i||++ra,i=aa(t),a=[],o=ta||{time:Date.now(),ease:Rr,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(a=i.time,o=Te((function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h}),0,a),f=c[n]={tween:new T,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}ea.call=K.call,ea.empty=K.empty,ea.node=K.node,ea.size=K.size,a.transition=function(t,e){return t&&t.transition?$i?t.transition(e):t:a.selection().transition(t)},a.transition.prototype=ea,ea.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=Q(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",o[1]-o[0])}function v(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function g(){var f,g,m=this,y=a.select(a.event.target),x=r.of(m,arguments),b=a.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&n,M=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),A=Tt(m),k=a.mouse(m),L=a.select(c(m)).on("keydown.brush",(function(){32==a.event.keyCode&&(T||(f=null,k[0]-=o[1],k[1]-=s[1],T=2),H())})).on("keyup.brush",(function(){32==a.event.keyCode&&2==T&&(k[0]+=o[1],k[1]+=s[1],T=0,H())}));if(a.event.changedTouches?L.on("touchmove.brush",O).on("touchend.brush",R):L.on("mousemove.brush",O).on("mouseup.brush",R),b.interrupt().selectAll("*").interrupt(),T)k[0]=o[0]-k[0],k[1]=s[0]-k[1];else if(_){var S=+/w$/.test(_),E=+/^n/.test(_);g=[o[1-S]-k[0],s[1-E]-k[1]],k[0]=o[S],k[1]=s[E]}else a.event.altKey&&(f=k.slice());function O(){var t=a.mouse(m),e=!1;g&&(t[0]+=g[0],t[1]+=g[1]),T||(a.event.altKey?(f||(f=[(o[0]+o[1])/2,(s[0]+s[1])/2]),k[0]=o[+(t[0]>2],a+=n[(3&r[e])<<4|r[e+1]>>4],a+=n[(15&r[e+1])<<2|r[e+2]>>6],a+=n[63&r[e+2]];return i%3==2?a=a.substring(0,a.length-1)+"=":i%3==1&&(a=a.substring(0,a.length-2)+"=="),a},s=function(t){var e,r,n,a,o,s=.75*t.length,l=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),f=new Uint8Array(c);for(e=0;e>4,f[u++]=(15&n)<<4|a>>2,f[u++]=(3&a)<<6|63&o;return c}},2420:function(t){t.exports=function(t,e,r){return er?r:t:te?e:t}},7592:function(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},2160:function(t,e,r){"use strict";var n=r(6824),i=r(2420),a=r(2512);t.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(a(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},6824:function(t,e,r){"use strict";var n=r(5532),i=r(3576),a=r(2420);t.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},5532:function(t,e,r){"use strict";var n=r(7592);t.exports=function(t){var e,r,a=[],o=1;if("string"==typeof t)if(t=t.toLowerCase(),n[t])a=n[t].slice(),r="rgb";else if("transparent"===t)o=0,r="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1);o=1,(c=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===c&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===c&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),r="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],u="rgb"===l;r=s=l.replace(/a$/,"");var c="cmyk"===s?4:"gray"===s?1:3;a=e[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===s?255*parseFloat(t)/100:parseFloat(t);if("h"===s[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==i[t])return i[t]}return parseFloat(t)})),l===s&&a.push(1),o=u||void 0===a[c]?1:a[c],a=a.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),r=t.match(/([a-z])/gi).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(a=[t[0],t[1],t[2]],r="rgb",o=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(r="rgb",a=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(r="hsl",a=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),o=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(o/=100)):(r="rgb",a=[t>>>16,(65280&t)>>>8,255&t]);return{space:r,values:a,alpha:o}};var i={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},3576:function(t,e,r){"use strict";var n=r(9336);t.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},9336:function(t){"use strict";t.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},7624:function(t,e,r){"use strict";function n(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}r.d(e,{E9:function(){return h},SO:function(){return v}});var i,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(t){if(!(e=a.exec(t)))throw new Error("invalid format: "+t);var e;return new s({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function s(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function l(t,e){var r=n(t,e);if(!r)return t+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}o.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var u={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return l(100*t,e)},r:l,s:function(t,e){var r=n(t,e);if(!r)return t+"";var a=r[0],o=r[1],s=o-(i=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+n(t,Math.max(0,e+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var f,h,d=Array.prototype.map,p=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function v(t){var e,r,a=void 0===t.grouping||void 0===t.thousands?c:(e=d.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var i=t.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(r)}),s=void 0===t.currency?"":t.currency[0]+"",l=void 0===t.currency?"":t.currency[1]+"",f=void 0===t.decimal?".":t.decimal+"",h=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(d.call(t.numerals,String)),v=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",m=void 0===t.nan?"NaN":t.nan+"";function y(t){var e=(t=o(t)).fill,r=t.align,n=t.sign,c=t.symbol,d=t.zero,y=t.width,x=t.comma,b=t.precision,_=t.trim,w=t.type;"n"===w?(x=!0,w="g"):u[w]||(void 0===b&&(b=12),_=!0,w="g"),(d||"0"===e&&"="===r)&&(d=!0,e="0",r="=");var M="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===c?l:/[%p]/.test(w)?v:"",A=u[w],k=/[defgprs%]/.test(w);function L(t){var o,s,l,u=M,c=T;if("c"===w)c=A(t)+c,t="";else{var v=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:A(Math.abs(t),b),_&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),v&&0==+t&&"+"!==n&&(v=!1),u=(v?"("===n?n:g:"-"===n||"("===n?"":n)+u,c=("s"===w?p[8+i/3]:"")+c+(v&&"("===n?")":""),k)for(o=-1,s=t.length;++o(l=t.charCodeAt(o))||l>57){c=(46===l?f+t.slice(o+1):t.slice(o))+c,t=t.slice(0,o);break}}x&&!d&&(t=a(t,1/0));var L=u.length+t.length+c.length,S=L>1)+u+t+c+S.slice(L);break;default:t=S+u+t+c}return h(t)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),L.toString=function(){return t+""},L}return{format:y,formatPrefix:function(t,e){var r,i=y(((t=o(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=n(Math.abs(r)))?r[1]:NaN)/3)))),s=Math.pow(10,-a),l=p[8+a/3];return function(t){return i(s*t)+l}}}}f=v({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),h=f.format,f.formatPrefix},4336:function(t,e,r){"use strict";r.d(e,{Yn:function(){return p},m_:function(){return h},E9:function(){return v}});var n=r(8208),i=r(8931),a=r(6192),o=r(8936),s=r(2171),l=r(3528);function u(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function c(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function f(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function h(t){var e=t.dateTime,r=t.date,s=t.time,l=t.periods,h=t.days,d=t.shortDays,p=t.months,v=t.shortMonths,m=w(l),y=M(l),x=w(h),b=M(h),_=w(d),Lt=M(d),St=w(p),Et=M(p),Ot=w(v),Ct=M(v),Rt={a:function(t){return d[t.getDay()]},A:function(t){return h[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return p[t.getMonth()]},c:null,d:Y,e:Y,f:Z,H:G,I:W,j:q,L:X,m:J,M:K,p:function(t){return l[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:At,s:kt,S:Q,u:$,U:tt,V:et,w:rt,W:nt,x:null,X:null,y:it,Y:at,Z:ot,"%":Tt},Dt={a:function(t){return d[t.getUTCDay()]},A:function(t){return h[t.getUTCDay()]},b:function(t){return v[t.getUTCMonth()]},B:function(t){return p[t.getUTCMonth()]},c:null,d:st,e:st,f:ht,H:lt,I:ut,j:ct,L:ft,m:dt,M:pt,p:function(t){return l[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:At,s:kt,S:vt,u:gt,U:mt,V:yt,w:xt,W:bt,x:null,X:null,y:_t,Y:wt,Z:Mt,"%":Tt},Pt={a:function(t,e,r){var n=_.exec(e.slice(r));return n?(t.w=Lt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=x.exec(e.slice(r));return n?(t.w=b[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Ot.exec(e.slice(r));return n?(t.m=Ct[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return Ft(t,e,r,n)},d:P,e:P,f:j,H:z,I:z,j:I,L:B,m:D,M:F,p:function(t,e,r){var n=m.exec(e.slice(r));return n?(t.p=y[n[0].toLowerCase()],r+n[0].length):-1},q:R,Q:H,s:V,S:N,u:A,U:k,V:L,w:T,W:S,x:function(t,e,n){return Ft(t,r,e,n)},X:function(t,e,r){return Ft(t,s,e,r)},y:O,Y:E,Z:C,"%":U};function It(t,e){return function(r){var n,i,a,o=[],s=-1,l=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in h||(h.w=1),"Z"in h?(l=(s=c(f(h.y,0,1))).getUTCDay(),s=l>4||0===l?n.ot.ceil(s):(0,n.ot)(s),s=i.c.offset(s,7*(h.V-1)),h.y=s.getUTCFullYear(),h.m=s.getUTCMonth(),h.d=s.getUTCDate()+(h.w+6)%7):(l=(s=u(f(h.y,0,1))).getDay(),s=l>4||0===l?a.qT.ceil(s):(0,a.qT)(s),s=o.c.offset(s,7*(h.V-1)),h.y=s.getFullYear(),h.m=s.getMonth(),h.d=s.getDate()+(h.w+6)%7)}else("W"in h||"U"in h)&&("w"in h||(h.w="u"in h?h.u%7:"W"in h?1:0),l="Z"in h?c(f(h.y,0,1)).getUTCDay():u(f(h.y,0,1)).getDay(),h.m=0,h.d="W"in h?(h.w+6)%7+7*h.W-(l+5)%7:h.w+7*h.U-(l+6)%7);return"Z"in h?(h.H+=h.Z/100|0,h.M+=h.Z%100,c(h)):u(h)}}function Ft(t,e,r,n){for(var i,a,o=0,s=e.length,l=r.length;o=l)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Pt[i in g?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Rt.x=It(r,Rt),Rt.X=It(s,Rt),Rt.c=It(e,Rt),Dt.x=It(r,Dt),Dt.X=It(s,Dt),Dt.c=It(e,Dt),{format:function(t){var e=It(t+="",Rt);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=It(t+="",Dt);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+="",!0);return e.toString=function(){return t},e}}}var d,p,v,g={"-":"",_:" ",0:"0"},m=/^\s*\d+/,y=/^%/,x=/[\\^$*+?|[\]().{}]/g;function b(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function C(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function R(t,e,r){var n=m.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function D(t,e,r){var n=m.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function P(t,e,r){var n=m.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function I(t,e,r){var n=m.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function z(t,e,r){var n=m.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function F(t,e,r){var n=m.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function N(t,e,r){var n=m.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function B(t,e,r){var n=m.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function j(t,e,r){var n=m.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function U(t,e,r){var n=y.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function H(t,e,r){var n=m.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function V(t,e,r){var n=m.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Y(t,e){return b(t.getDate(),e,2)}function G(t,e){return b(t.getHours(),e,2)}function W(t,e){return b(t.getHours()%12||12,e,2)}function q(t,e){return b(1+o.c.count((0,s.c)(t),t),e,3)}function X(t,e){return b(t.getMilliseconds(),e,3)}function Z(t,e){return X(t,e)+"000"}function J(t,e){return b(t.getMonth()+1,e,2)}function K(t,e){return b(t.getMinutes(),e,2)}function Q(t,e){return b(t.getSeconds(),e,2)}function $(t){var e=t.getDay();return 0===e?7:e}function tt(t,e){return b(a.uU.count((0,s.c)(t)-1,t),e,2)}function et(t,e){var r=t.getDay();return t=r>=4||0===r?(0,a.kD)(t):a.kD.ceil(t),b(a.kD.count((0,s.c)(t),t)+(4===(0,s.c)(t).getDay()),e,2)}function rt(t){return t.getDay()}function nt(t,e){return b(a.qT.count((0,s.c)(t)-1,t),e,2)}function it(t,e){return b(t.getFullYear()%100,e,2)}function at(t,e){return b(t.getFullYear()%1e4,e,4)}function ot(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+b(e/60|0,"0",2)+b(e%60,"0",2)}function st(t,e){return b(t.getUTCDate(),e,2)}function lt(t,e){return b(t.getUTCHours(),e,2)}function ut(t,e){return b(t.getUTCHours()%12||12,e,2)}function ct(t,e){return b(1+i.c.count((0,l.c)(t),t),e,3)}function ft(t,e){return b(t.getUTCMilliseconds(),e,3)}function ht(t,e){return ft(t,e)+"000"}function dt(t,e){return b(t.getUTCMonth()+1,e,2)}function pt(t,e){return b(t.getUTCMinutes(),e,2)}function vt(t,e){return b(t.getUTCSeconds(),e,2)}function gt(t){var e=t.getUTCDay();return 0===e?7:e}function mt(t,e){return b(n.EV.count((0,l.c)(t)-1,t),e,2)}function yt(t,e){var r=t.getUTCDay();return t=r>=4||0===r?(0,n.yA)(t):n.yA.ceil(t),b(n.yA.count((0,l.c)(t),t)+(4===(0,l.c)(t).getUTCDay()),e,2)}function xt(t){return t.getUTCDay()}function bt(t,e){return b(n.ot.count((0,l.c)(t)-1,t),e,2)}function _t(t,e){return b(t.getUTCFullYear()%100,e,2)}function wt(t,e){return b(t.getUTCFullYear()%1e4,e,4)}function Mt(){return"+0000"}function Tt(){return"%"}function At(t){return+t}function kt(t){return Math.floor(+t/1e3)}d=h({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),p=d.format,d.parse,v=d.utcFormat,d.utcParse},8936:function(t,e,r){"use strict";r.d(e,{m:function(){return o}});var n=r(1628),i=r(9792),a=(0,n.c)((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.iy)/i.SK}),(function(t){return t.getDate()-1}));e.c=a;var o=a.range},9792:function(t,e,r){"use strict";r.d(e,{KK:function(){return s},SK:function(){return o},cg:function(){return a},iy:function(){return i},yc:function(){return n}});var n=1e3,i=6e4,a=36e5,o=864e5,s=6048e5},3220:function(t,e,r){"use strict";r.r(e),r.d(e,{timeDay:function(){return m.c},timeDays:function(){return m.m},timeFriday:function(){return y.iB},timeFridays:function(){return y.sJ},timeHour:function(){return v},timeHours:function(){return g},timeInterval:function(){return n.c},timeMillisecond:function(){return a},timeMilliseconds:function(){return o},timeMinute:function(){return h},timeMinutes:function(){return d},timeMonday:function(){return y.qT},timeMondays:function(){return y.QP},timeMonth:function(){return b},timeMonths:function(){return _},timeSaturday:function(){return y.Wc},timeSaturdays:function(){return y.aI},timeSecond:function(){return u},timeSeconds:function(){return c},timeSunday:function(){return y.uU},timeSundays:function(){return y.Ab},timeThursday:function(){return y.kD},timeThursdays:function(){return y.eC},timeTuesday:function(){return y.Mf},timeTuesdays:function(){return y.Oc},timeWednesday:function(){return y.eg},timeWednesdays:function(){return y.sn},timeWeek:function(){return y.uU},timeWeeks:function(){return y.Ab},timeYear:function(){return w.c},timeYears:function(){return w.Q},utcDay:function(){return E.c},utcDays:function(){return E.o},utcFriday:function(){return O.od},utcFridays:function(){return O.iG},utcHour:function(){return L},utcHours:function(){return S},utcMillisecond:function(){return a},utcMilliseconds:function(){return o},utcMinute:function(){return T},utcMinutes:function(){return A},utcMonday:function(){return O.ot},utcMondays:function(){return O.iO},utcMonth:function(){return R},utcMonths:function(){return D},utcSaturday:function(){return O.Ad},utcSaturdays:function(){return O.K8},utcSecond:function(){return u},utcSeconds:function(){return c},utcSunday:function(){return O.EV},utcSundays:function(){return O.Wq},utcThursday:function(){return O.yA},utcThursdays:function(){return O.ob},utcTuesday:function(){return O.sG},utcTuesdays:function(){return O.kl},utcWednesday:function(){return O._6},utcWednesdays:function(){return O.W_},utcWeek:function(){return O.EV},utcWeeks:function(){return O.Wq},utcYear:function(){return P.c},utcYears:function(){return P.i}});var n=r(1628),i=(0,n.c)((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?(0,n.c)((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i,o=i.range,s=r(9792),l=(0,n.c)((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*s.yc)}),(function(t,e){return(e-t)/s.yc}),(function(t){return t.getUTCSeconds()})),u=l,c=l.range,f=(0,n.c)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s.yc)}),(function(t,e){t.setTime(+t+e*s.iy)}),(function(t,e){return(e-t)/s.iy}),(function(t){return t.getMinutes()})),h=f,d=f.range,p=(0,n.c)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s.yc-t.getMinutes()*s.iy)}),(function(t,e){t.setTime(+t+e*s.cg)}),(function(t,e){return(e-t)/s.cg}),(function(t){return t.getHours()})),v=p,g=p.range,m=r(8936),y=r(6192),x=(0,n.c)((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),b=x,_=x.range,w=r(2171),M=(0,n.c)((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*s.iy)}),(function(t,e){return(e-t)/s.iy}),(function(t){return t.getUTCMinutes()})),T=M,A=M.range,k=(0,n.c)((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*s.cg)}),(function(t,e){return(e-t)/s.cg}),(function(t){return t.getUTCHours()})),L=k,S=k.range,E=r(8931),O=r(8208),C=(0,n.c)((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),R=C,D=C.range,P=r(3528)},1628:function(t,e,r){"use strict";r.d(e,{c:function(){return a}});var n=new Date,i=new Date;function a(t,e,r,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(r){return t(r=new Date(r-1)),e(r,1),t(r),r},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(a=new Date(+r)),e(r,i),t(r)}while(a=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(s.count=function(e,a){return n.setTime(+e),i.setTime(+a),t(n),t(i),Math.floor(r(n,i))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}},8931:function(t,e,r){"use strict";r.d(e,{o:function(){return o}});var n=r(1628),i=r(9792),a=(0,n.c)((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/i.SK}),(function(t){return t.getUTCDate()-1}));e.c=a;var o=a.range},8208:function(t,e,r){"use strict";r.d(e,{Ad:function(){return h},EV:function(){return o},K8:function(){return x},W_:function(){return g},Wq:function(){return d},_6:function(){return u},iG:function(){return y},iO:function(){return p},kl:function(){return v},ob:function(){return m},od:function(){return f},ot:function(){return s},sG:function(){return l},yA:function(){return c}});var n=r(1628),i=r(9792);function a(t){return(0,n.c)((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/i.KK}))}var o=a(0),s=a(1),l=a(2),u=a(3),c=a(4),f=a(5),h=a(6),d=o.range,p=s.range,v=l.range,g=u.range,m=c.range,y=f.range,x=h.range},3528:function(t,e,r){"use strict";r.d(e,{i:function(){return a}});var n=r(1628),i=(0,n.c)((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?(0,n.c)((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null},e.c=i;var a=i.range},6192:function(t,e,r){"use strict";r.d(e,{Ab:function(){return d},Mf:function(){return l},Oc:function(){return v},QP:function(){return p},Wc:function(){return h},aI:function(){return x},eC:function(){return m},eg:function(){return u},iB:function(){return f},kD:function(){return c},qT:function(){return s},sJ:function(){return y},sn:function(){return g},uU:function(){return o}});var n=r(1628),i=r(9792);function a(t){return(0,n.c)((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.iy)/i.KK}))}var o=a(0),s=a(1),l=a(2),u=a(3),c=a(4),f=a(5),h=a(6),d=o.range,p=s.range,v=l.range,g=u.range,m=c.range,y=f.range,x=h.range},2171:function(t,e,r){"use strict";r.d(e,{Q:function(){return a}});var n=r(1628),i=(0,n.c)((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?(0,n.c)((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null},e.c=i;var a=i.range},2512:function(t){t.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},1252:function(t){"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,a),n(r)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}v(t,e,a,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,a,o,u;if(s(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=l(t))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)n(l,this,e);else{var u=l.length,c=p(l,u);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return h(this,t,!0)},a.prototype.rawListeners=function(t){return h(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},a.prototype.listenerCount=d,a.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},8248:function(t,e,r){"use strict";var n=r(4576);t.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0==(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},3380:function(t){t.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},9128:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},8324:function(t,e,r){var n;!function(i,a,o){a[i]=a[i]||function(){"use strict";var t,e,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function a(t,n){r.add(t,n),e||(e=i(r.drain))}function o(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t0&&a(s,r))}catch(t){c.call(new h(r),t)}}}function c(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&a(s,e))}function f(t,e,r,n){for(var i=0;i2&&(i.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==e[o])return a.unshift(r),i.push(a);if(a.lengtha!=d>a&&i<(h-c)*(a-f)/(d-f)+c&&(o=!o)}return o}},4756:function(t,e,r){var n,i=r(2928),a=r(8648),o=r(9819),s=r(1403),l=r(2368),u=r(7792),c=!1,f=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=i():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,f,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,f,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},2928:function(t){t.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},8648:function(t){t.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},7792:function(t){var e={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0}))}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),d=e.pointsSame(s,c);if(h&&d)return n;var p=!h&&e.pointBetween(o,u,c),v=!d&&e.pointBetween(s,u,c);if(h)return v?l(n,s):l(t,c),n;p&&(d||(v?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=u(h),p=d.before?d.before.ev:null,v=d.after?d.after.ev:null;function g(){if(p){var t=c(h,p);if(t)return t}return!!v&&c(h,v)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!v&&v.seg);var m,y,x=g();if(x)t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(x.seg),h.other.remove(),h.remove();if(a.getHead()!==h){r&&r.rewind(h.seg);continue}t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=v?v.seg.myFill.above:i,h.seg.myFill.above=y?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(m=v?h.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m}),r&&r.status(h.seg,!!p&&p.seg,!!v&&v.seg),h.other.status=d.insert(n.node({ev:h}))}else{var b=h.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&c(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=D(t,360),e=D(e,100),r=D(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(t.h,f,d),p=!0,v="hsl"),t.hasOwnProperty("a")&&(l=t.a)),l=R(l),{ok:p,format:t.format||v,r:u(255,c(s.r,0)),g:u(255,c(s.g,0)),b:u(255,c(s.b,0)),a:l}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=s++}function d(t,e,r){t=D(t,255),e=D(e,255),r=D(r,255);var n,i,a=c(t,e,r),o=u(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(h(n));return a}function E(t,e){e=e||6;for(var r=h(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(h({h:n,s:i,v:a})),a=(a+s)%1;return o}h.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:i.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=R(t),this._roundA=l(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=l(360*t.h),r=l(100*t.s),n=l(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=d(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=d(this._r,this._g,this._b),e=l(360*t.h),r=l(100*t.s),n=l(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return v(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var a=[z(l(t).toString(16)),z(l(e).toString(16)),z(l(r).toString(16)),z(N(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*D(this._r,255))+"%",g:l(100*D(this._g,255))+"%",b:l(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*D(this._r,255))+"%, "+l(100*D(this._g,255))+"%, "+l(100*D(this._b,255))+"%)":"rgba("+l(100*D(this._r,255))+"%, "+l(100*D(this._g,255))+"%, "+l(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+g(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=h(t);r="#"+g(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return h(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(M,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(L,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},h.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:F(t[n]));t=r}return h(t,e)},h.equals=function(t,e){return!(!t||!e)&&h(t).toRgbString()==h(e).toRgbString()},h.random=function(){return h.fromRatio({r:f(),g:f(),b:f()})},h.mix=function(t,e,r){r=0===r?0:r||50;var n=h(t).toRgb(),i=h(e).toRgb(),a=r/100;return h({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},h.readability=function(t,e){var r=h(t),n=h(e);return(i.max(r.getLuminance(),n.getLuminance())+.05)/(i.min(r.getLuminance(),n.getLuminance())+.05)},h.isReadable=function(t,e,r){var n,i,a,o,s,l=h.readability(t,e);switch(i=!1,(a=r,"AA"!==(o=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==o&&(o="AA"),"small"!==(s=(a.size||"small").toLowerCase())&&"large"!==s&&(s="small"),n={level:o,size:s}).level+n.size){case"AAsmall":case"AAAlarge":i=l>=4.5;break;case"AAlarge":i=l>=3;break;case"AAAsmall":i=l>=7}return i},h.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=h(e[u]));return h.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,h.mostReadable(t,["#fff","#000"],r))};var O=h.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=h.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(O);function R(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function D(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=u(e,c(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function P(t){return u(1,c(0,t))}function I(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function F(t){return t<=1&&(t=100*t+"%"),t}function N(t){return i.round(255*parseFloat(t)).toString(16)}function B(t){return I(t)/255}var j,U,H,V=(U="[\\s|\\(]+("+(j="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",H="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+H),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Y(t){return!!V.CSS_UNIT.exec(t)}t.exports?t.exports=h:void 0===(n=function(){return h}.call(e,r,e,t))||(t.exports=n)}(Math)},5408:function(t,e,r){var n=r(3380);t.exports=function(t){return n("webgl",t)}},7020:function(t,e,r){var n=r(8700),i=r(896),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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(l);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(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].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 i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?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 n.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 i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(i=a.newDate(l,u,c)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/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=f[t-f[0]];if(e>(r>>13?12:11))throw n.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 i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a={}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=f[o.year-f[0]],d=c>>13;u=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(v>>5&15)-1,(31&v)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a={}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(i.year,i.month-1,i.day);l=Math.round((c-u)/864e5);var d,p=f[a.year-f[0]];for(d=0;d<13;d++){var v=p&1<<12-d?30:29;if(l>13;return!g||d=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.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 o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},2787:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.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,n.local.invalidYear||n.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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.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)}}),n.calendars.ethiopian=a},2084:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.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,n.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,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(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 i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=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)}}),n.calendars.hebrew=a},6368:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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īs","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,n.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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+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)}}),n.calendars.islamic=a},4747:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.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,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.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)}}),n.calendars.julian=a},5616:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.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,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.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,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s(20+(t-=this.jdEpoch),20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.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)}}),n.calendars.mayan=a},632:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.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,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.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,n.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 i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=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)}}),n.calendars.nanakshahi=a},5420:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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,n.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,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,u)},_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,n.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 i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/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=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),f=t-this.toJD(l,c,1)+1;return this.newDate(l,c,f)}}),n.calendars.persian=a,n.calendars.jalali=a},9075:function(t,e,r){var n=r(8700),i=r(896),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);return t=this._t2gYear(e.year()),a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=this._t2gYear(i.year()),a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=this._t2gYear(i.year()),a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.taiwan=o},4592:function(t,e,r){var n=r(8700),i=r(896),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.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,n.local.invalidYear);return t=this._t2gYear(e.year()),a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return t=this._t2gYear(i.year()),a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.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 i=this._validate(t,e,r,n.local.invalidDate);return t=this._t2gYear(i.year()),a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.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)}}),n.calendars.thai=o},5348:function(t,e,r){var n=r(8700),i=r(896);function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","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,n.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,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-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),s=a+1,l=i-12*a,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[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]},8700:function(t,e,r){var n=r(896);function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){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]}}}),n(a.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(u.local.invalidDate||u.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(u.local.differentCalendars||u.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?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.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,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.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,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.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,u.local.invalidDate||u.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,u.local.invalidDate||u.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 u=t.exports=new i;u.cdate=a,u.baseCalendar=s,u.calendars.gregorian=l},5168:function(t,e,r){var n=r(896),i=r(8700);n(i.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"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.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 i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,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,f=r.monthNames||this.local.monthNames,h=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;_+n1}),d=function(t,e,r,n){var i=""+e;if(h(t,n))for(;i.length1},x=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=v;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,d,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,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)}})}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}return r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(7988)}()}));




© 2015 - 2024 Weber Informatics LLC | Privacy Policy